0

如果我有一个 CMS 并创建一个名为“Name”的页面,但我还有一个名为“Name”的控制器

有没有办法让名为“名称”的页面不会覆盖控制器

我尝试了以下路线,但似乎 CMS db 页面“名称”仍然覆盖

路线:

$route['name'] = "name";
$route['name/details/(:num)/(:num)'] = "screenings/details/$1/$2";
4

1 回答 1

0

您只需要添加:

$route['name'] = "name"; 

之后:

$route['name/details/(:num)/(:num)'] = "screenings/details/$1/$2";

所以在你的情况下,它将是:

$route['name/details/(:num)/(:num)'] = "screenings/details/$1/$2";
$route['name'] = "name/index"; //It is better to add the /index just to make sure

据我记得在 Codeigniter 中,路由优先级是您首先添加的。

于 2013-10-30T22:04:23.403 回答