Hi I created several module for my own CMS like category, article, core , ...
now how can I access these modules with url like:http://local开发者_高级运维host/mycms/admin/category
http://localhost/mycms/admin/article , ...note: the admin is not module, it's only prefix
In "application/Bootstrap.php":
public function _initRoute(){
$frontController = Zend_Controller_Front::getInstance();
$router = $frontController->getRouter(); // returns a rewrite router by default
$router->addRoute(
'category',
new Zend_Controller_Router_Route('admin/category/:controller/:action',
array('module' => 'category',
'controller' => 'index',
'action' => 'index'))
);
}
Then type in URL : ex : http://localhost/mycms/admin/category and you get there.
Same with others.
精彩评论