Created
October 17, 2010 03:51
-
-
Save mgirouard/630520 to your computer and use it in GitHub Desktop.
How to enable 'admin_' prefixed routes in Lithium
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
<?php | |
/* ----- snip (omitting everything already in config/bootstrap/action.php) ----- */ | |
/** | |
* Filter to capture any admin-specific requests | |
* This simply updates the internal action name for dispatching purposes. In order for this to | |
* properly work across the board, you'll need to enable a persistent param for `admin` in your | |
* routes configuration. Something to the effect of the following will do nicely: | |
* | |
* {{{ | |
* Router::connect( | |
* '/admin/{:controller}/{:action}/{:args}', | |
* array('admin' => true), | |
* array('persist' => array('admin', 'controller')) | |
* ); | |
* }}} | |
*/ | |
Dispatcher::config(array( | |
'rules' => array('admin' => array('action' => 'admin_{:action}')) | |
)); |
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
<?php | |
/* ----- snip (omitting everything already in config/routes.php) ----- */ | |
/** | |
* Admin Routes | |
*/ | |
Router::connect( | |
'/admin/{:controller}/{:action}/{:args}', | |
array('admin' => true), | |
array('persist' => array('admin', 'controller')) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment