1. Go to this page and download the library: Download horizom/routing 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/ */
horizom / routing example snippets
declare(strict_types=1);
use Horizom\Routing\RouterFactory;
use Nyholm\Psr7\ServerRequest;
use Psr\Container\ContainerInterface;
$container = /* PSR-11 container */;
$router = (new RouterFactory())->create($container);
$router->get('/users/{id}', App\Http\Controllers\UserController::class . '@show');
$request = new ServerRequest('GET', '/users/42');
$response = $router->getRouter()->handle($request);