Created
August 17, 2012 08:06
-
-
Save notomato/3376894 to your computer and use it in GitHub Desktop.
Quick and dirty admin
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 | |
// somewhere in config/bootstrap | |
Dispatcher::config(array('rules' => array( | |
'admin' => array( | |
'action' => 'admin_{:action}' | |
) | |
))); | |
// app/classes/PostsController.php | |
class PostsController extends Base { | |
public function admin_index() { | |
//... | |
} | |
public function index() { | |
//... | |
} | |
} | |
// config/routes.php | |
Router::connect( | |
'/admin/{:args}', | |
array('admin' => true), | |
array('continue' => true) | |
); | |
// source: http://www.slideshare.net/nateabele/the-state-of-lithium |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment