1. Go to this page and download the library: Download cakesuit/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/ */
cakesuit / route example snippets
...
Plugin::load('Cakesuit/Route');
public function initialize()
{
$this->loadHelper('Cakesuit/Route.Route');
}
Route::scope('/', function (RouteBuilder $routes) {
$routes->connect('/users', ['controller' => 'Users', 'action' => 'index'], ['_name' => 'users:index']);
$routes->connect('/users/:id', ['controller' => 'Users', 'action' => 'view'], ['_name' => 'users:view']);
// OR with verbe GET if you use version >= 3.5.0
$routes->get('/users', ['controller' => 'Users', 'action' => 'index'], 'users:index');
$routes->get('/users/view/:id', ['controller' => 'Users', 'action' => 'view'], 'users:view');
});