如何在cakePHP路由中的URL中删除/索引? [英] How can i remove /index in URL in routing in cakePHP?
本文介绍了如何在cakePHP路由中的URL中删除/索引?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要移除网址中的 / index
。
我已经尝试过routes.php文件:
I have already tried the following in routes.php file :
Router::connect('/Home/:index', array('controller' => 'Homes'));
和:
Router::connect('/Home/', array('controller' => 'Homes','action'=>'index'));
推荐答案
尝试
Router::connect('/Home', array('controller' => 'Homes','action'=>'index'));
这篇关于如何在cakePHP路由中的URL中删除/索引?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文