PHP code example of yakisova41 / routing

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

    

yakisova41 / routing example snippets


use Yakisova41\Routing\Routing;
use Yakisova41\Routing\Route;

Route::put('/',['GET'],function(){
    echo 'Hello world!!';
});

Routing::listen();

Route::put('/page/{Pageid}',['GET'],function($req){
    echo $req['parameters']['Pageid'];
});

Route::put('/',['POST'],function(){
    echo 'Hello world!!';
});

Route::put('/',['GET', 'POST'],function(){
    echo 'Hello world!!';
});