1. Go to this page and download the library: Download dinhthibc/feazy 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/ */
namespace Application\Controller;
use Feazy\Controller\Controller;
class UserController extends Controller
{
public function index() {
echo 'This is users page';
}
public function get($id) {
echo "Get user details with id = $id";
}
}
define('ROOT_PATH', __DIR__);
$loader = uter = new \Feazy\Common\Router($_SERVER['REQUEST_URI']);
\Feazy\Common\DIManager::add('view', new \Feazy\Common\View('template'));
$router->get('/', 'IndexController@index');
namespace Application\Controller;
use Feazy\Controller\Controller;
class IndexController extends Controller
{
public function index() {
$this->view->setTitle('Homepage');
$this->view->render('index/index', [
'myVariable' => 'This is a variable value'
]);
}
}
class IndexController extends Controller
{
public function index() {
$this->view->setTitle('Homepage');
$this->view->render('index/index', [
'myVariable' => 'This is a variable value'
]);
}
}
echo $myVariable;
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.