Last active
June 12, 2016 15:35
-
-
Save subhanahmed047/028726abf3ca6c77944d95f50969c4fb to your computer and use it in GitHub Desktop.
Some actions in admin prefix some in /
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Router::scope('/', function ($routes) { | |
$routes->plugin( | |
'IncUsers', | |
['path' => '/'], | |
function (RouteBuilder $routes) { | |
$routes->connect('/login/', ['controller' => 'Users', 'action' => 'login']); | |
$routes->connect('/register/', ['controller' => 'Users', 'action' => 'add']); | |
$routes->fallbacks('DashedRoute'); | |
}); | |
}); | |
Router::prefix('admin', function ($routes) { | |
$routes->plugin( | |
'IncUsers', | |
['path' => '/users'], | |
function (RouteBuilder $routes) { | |
$routes->connect('/', ['controller' => 'Users', 'action' => 'index']); | |
$routes->connect('/logout/', ['controller' => 'Users', 'action' => 'logout']); | |
$routes->connect('/profile/:id', ['controller' => 'Users', 'action' => 'view'], | |
['id' => '\d+', 'pass' => ['id']]); | |
$routes->fallbacks('DashedRoute'); | |
} | |
); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment