1. Go to this page and download the library: Download echo-fusion/routemanager 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/ */
echo-fusion / routemanager example snippets
use EchoFusion\RouteManager\Router;
use EchoFusion\RouteManager\RouteMatcher\RouteMatcher;
$routeMatcher = new RouteMatcher();
$router = new Router($routeMatcher);
try {
$routeMatch = $router->dispatch($request);
} catch (RouteNotFoundException $e) {
// Handle route not found
} catch (Throwable $exception) {
// Handle any other errors
}
$action = $routeMatch->getRoute()->getAction();
// Get the route parameters and request
$routeParams = $routeMatch->getParams();
$params = array_merge($routeParams, [$request]);
// Call the action (callable or controller method) with type hinting
return call_user_func_array($action, $params);
bash
$ composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.