PHP code example of fitdev-pro / router

1. Go to this page and download the library: Download fitdev-pro/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/ */

    

fitdev-pro / router example snippets



use FitdevPro\FitRouter\Router;
use FitdevPro\FitRouter\Request\HttpRequest;
use FitdevPro\FitRouter\RouteCollection\RouteCollection;
use FitdevPro\FitRouter\UrlGenerator\BaseGenerator;
use FitdevPro\FitRouter\RouteMatchers\MVCDynamicMatcher;

$routerRequest = new HttpRequest();
$routerRequest->addRequestParam('extra', 'FooBar');

$router = new Router(new RouteCollection(), new MVCDynamicMatcher(), new BaseGenerator());

$route = $router->match( $routerRequest );