1. Go to this page and download the library: Download joanrodas/plubo-routes 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/ */
joanrodas / plubo-routes example snippets
PluboRoutes\RoutesProcessor::init();
add_filter( 'plubo/routes', array($this, 'add_routes') );
public function add_routes( $routes ) {
//Your routes
return $routes;
}
use PluboRoutes\Route\Route;
add_filter( 'plubo/routes', array($this, 'add_routes') );
public function add_routes( $routes ) {
$routes[] = new Route('clients/list', 'template_name');
//SAGE 10 example
$routes[] = new Route(
'dashboard/{subpage:slug}',
function($matches) {
$subpage = 'dashboard/' . $matches['subpage'];
return locate_template( app('sage.finder')->locate($subpage) );
},
[
'name' => 'my-route'
]
);
return $routes;
}