PHP code example of inmanturbo / path-router

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

    

inmanturbo / path-router example snippets


return [
    'active' => env('PATH_ROUTER_ACTIVE', true),
    'routes' => [
        [
            'route_prefix' => 'view',
            'active' => env('PATH_ROUTER_ACTIVE', true),
            'root_dir' => 'www',
            'middleware' => [
                // 'web',
                // 'auth',
            ],
            'headers' => [

                'pdf' => [
                    'Content-Type' => 'application/pdf',
                ],
            ],
            'handler' => new \Inmanturbo\PathRouter\Handlers\PathBasedViewResponseHandler,
        ],
    ],
];