PHP code example of alexoliverwd / basic-router
1. Go to this page and download the library: Download alexoliverwd/basic-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/ */
alexoliverwd / basic-router example snippets
use AOWD\Router;
$router = new Router();
$router->register('GET', '/', function () {
echo 'get';
});
$router->run();
$router->unregister('get', '/get');
$router->register404(function () {
echo '404 error';
});