PHP code example of nextras / static-router

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

    

nextras / static-router example snippets


use Nextras\Routing\StaticRouter;

$router = new StaticRouter(['Homepage:default' => 'index.php'], StaticRouter::ONE_WAY);

$router = new StaticRouter([
	'Homepage:default' => '',
	'Auth:signIn' => 'sign-in',
	'Auth:signOut' => 'sign-out',
	'Auth:signUp' => 'sign-up',
]);