PHP code example of jinnguyen / puja-route

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

    

jinnguyen / puja-route example snippets



$config = array(
    'root_namespace' => '\\Puja\\Route\\Demo\\', // You can change to match with controller class name on your app
    'default_controller' => 'Index', // Default controller
    'default_action' => 'index', // Default action
    'controller_dir' => __DIR__ . '/Controller/', // Folder that ontroller.php in $config[module_dir]

$route->addRoute('/testaddroute', '\\Test\\Add\\Route\\Namespace');

$router->build();

$router->getRoute('testaddroute') // get route at  of testaddroute