【发布时间】:2018-04-17 12:38:57
【问题描述】:
我有一个网址
http://localhost/himalaya/webmanager/recentUpdate/index/edit-recent-update-1
但我希望它使 URL 像这样:
http://localhost/himalaya/webmanager/recentUpdate/edit-recent-update-1.
控制器名称为recentUpdate,方法名称为index。我的问题是如何从 codeigniter 框架中的 URL 中删除 index 方法名称?
【问题讨论】:
-
我已按照您的说明进行操作,但索引方法并未隐藏在 url 中
-
您也可以为此使用路由。参见 CI 路由
-
我用过这个路由 $route['webmanager/recentUpdate/index/(:any)'] = 'webmanager/recentUpdate/$1';但不隐藏索引方法名称
-
因为您正在显示此 CI $route['new route'] = old route
-
所以我必须为路由控制器名称recentUpdate和参数写什么是通过索引方法。
标签: codeigniter