Skip to content

Instantly share code, notes, and snippets.

@subhanahmed047
Created June 11, 2016 13:43
Show Gist options
  • Save subhanahmed047/833f27216e086add254a28dfbf4e11ad to your computer and use it in GitHub Desktop.
Save subhanahmed047/833f27216e086add254a28dfbf4e11ad to your computer and use it in GitHub Desktop.
Routes for my users plugin
Router::prefix('admin', function ($routes) {
$routes->plugin(
'IncUsers',
['path' => '/users'],
function (RouteBuilder $routes) {
$routes->fallbacks('DashedRoute');
$routes->connect('/login/', ['controller' => 'Users', 'action' => 'login']);
$routes->connect('/register/', ['controller' => 'Users', 'action' => 'add']);
$routes->connect('/logout/', ['controller' => 'Users', 'action' => 'logout']);
$routes->connect('/profile/:id', ['controller' => 'Users', 'action' => 'view'],
['id' => '\d+', 'pass' => ['id']]);
}
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment