PHP code example of philiplambok / mikasa
1. Go to this page and download the library: Download philiplambok/mikasa library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
philiplambok / mikasa example snippets
namespace App\Controllers;
use App\Core\Controller;
class HomeController extends Controller
{
public function index()
{
return $this->view('welcome');
}
}
namespace App\Models;
use App\Core\Database;
class User extends Database
{
public $username;
// get all user in users table.
public function getList()
{
$sql = 'SELECT * FROM users ORDER BY id';
$query = $this->db->query($sql);
$result = $query->fetchAll(PDO::FETCH_OBJ);
return $result;
}
}