1. Go to this page and download the library: Download carlbennett/php-mvc 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/ */
carlbennett / php-mvc example snippets
namespace MySuperAwesomeProject;
use \CarlBennett\MVC\Libraries\GlobalErrorHandler;
use \CarlBennett\MVC\Libraries\Router;
use \CarlBennett\MVC\Libraries\Template;
use \RuntimeException;
// Can be used to route requests.
$router = new Router(
"\\MySuperAwesomeProject\\Controllers\\",
"\\MySuperAwesomeProject\\Views\\"
);
$router->addRoute( // URLs: /home, /home.htm, /home.html
// pattern, model, view
'#^/home(?:\.html?)?$#', 'Home', 'HomeHtml'
);
$router->route();
$router->send();
// Custom template engine powered by pure PHP, utilizes
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.