1. Go to this page and download the library: Download kito92/epicroute 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/ */
class CustomMiddleware implements \EpicRoute\Middleware{
/**
* This method will be executed before the routing
*
* @return mixed
*/
function before(){
// TODO: Implement before() method.
}
/**
* This method will be executed after the routing
*
* @return mixed
*/
function after(){
// TODO: Implement after() method.
}
}
$route->group(['middleware' => CustomMiddleware::class], function () use ($route){
$route->get('/users/:id{[0-9]*}', function ($id){
echo 'user id ' . $id;
});
$route->get('/users/:name', function ($name){
echo 'Welcome back ' . $name;
});
})->dispatch();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.