PHP code example of zodream / route

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

    

zodream / route example snippets


$router->get('gggggg', 'HomeController@aboutAction');
$router->group([
    'module' => 'Module\Blog\Module',
    'namespace' => '\Module\Blog\Service'
], function ($router) {
   $router->get('hhh/{id}/{name}?', 'HomeController@indexAction');
   $router->get('hhh', 'HomeController@indexAction');
});

class RouteServiceProvider extends ServiceProvider {
    public function register()
    {
        $this->mapWebRoutes($this->app->make(Router::class));
    }
    protected function mapWebRoutes(Router $router)
    {
        $router->group([
            'namespace' => 'Service\Home',
        ], __DIR__.'/routes.php');
    }
}