PHP code example of hoa / dispatcher

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

    

hoa / dispatcher example snippets


$router = new Hoa\Router\Http();
$router->get('w', '/(?<controller>[^/]+)/(?<action>\w+)\.html');

$dispatcher = new Hoa\Dispatcher\Basic();
$dispatcher->dispatch($router);