1. Go to this page and download the library: Download yzmcms/route 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/ */
route::get('/(:any)', function($slug) {
echo 'The slug is: ' . $slug;
});
route::exec();
route::get('/', function() {
echo 'I'm a GET request!';
});
route::post('/', function() {
echo 'I'm a POST request!';
});
route::any('/', function() {
echo 'I can be both a GET and a POST request!';
});
route::exec();
use yzmcms\route\route;
route::get('/', 'Controllers\demo@index');
route::get('page', 'Controllers\demo@page');
route::get('view/(:num)', 'Controllers\demo@view');
route::exec();
namespace controllers;
class Demo {
public function index()
{
echo 'home';
}
public function page()
{
echo 'page';
}
public function view($id)
{
echo $id;
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.