我在cakephp 2.8中创建web应用程序,我想在用户中使用2个以上的前缀。
示例:
http://localhost/project/admin,
http://localhost/project/employee,
http://localhost/project/customer
请推荐我。
提前谢谢。
发布于 2018-08-06 17:21:49
在cakephp中集成多个前缀和路由非常容易
在cakephp 2.x中,您必须完成以下步骤
转到app/Config/core.php并添加以下行
Configure::write('Routing.prefixes', array('admin','manager'));
现在,您必须为此编写路由。转到应用程序/Config/routes.php,添加以下行
Router::connect("admin/:controller",array('action'=>'index','admin'=>true));
Router::connect("admin/:controller/:action/*",array('admin'=>true));
Router::connect("manager/:controller",array('action'=>'index','manager'=>true));
Router::connect("manager/:controller/:action",array('manager'=>true));https://stackoverflow.com/questions/51704208
复制相似问题