PHP code example of mmantai / web-router
1. Go to this page and download the library: Download mmantai/web-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/ */
mmantai / web-router example snippets
use MMantai\WebRouter\Router;
//create a router object and register routes
$router = new Router();
$router->registerRoute("/test/{var}", function ($var) {
echo $var;
});
$router->registerRoute("/site/{var}", function ($var) {