1. Go to this page and download the library: Download evgsavosin/choco-router 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/ */
$router = new SimpleRouter([
'cacheDisable' => false,
'cacheDriver' => FileDriver::class,
'cacheOptions' => []
/*
For memcached driver, there passed array of servers.
For file driver, there passed path to cache directory.
*/
]);
use App\Action\FooAction;
$router = new SimpleRouter();
$router->load([FooAction::class]);
$router->resolve(/*...*/)->callableResolve(/*...*/);