我试图在Codeigniter中创建动态URL。下面的URL运行良好
codesup/tags/user-interface
其中,URL中的tags是静态值,而user-interface是动态值。但是当我单击Next按钮分页时,下面的URL
codesup/tags/user-interface/1
并给出了404 pages not found error
我试着做什么
$route['tags/(:num)'] = 'tags/index/$1';
$route['tags/(:any)'] = 'tags/view/$1';发布于 2019-04-12 12:53:37
这应该能行,
$route['tags/(:any)'] = 'tags/index/$1';
$route['tags/(:any)'] = 'tags/view/$1';
$route['tags/(:any)/(:num)'] = 'tags/index/$1/$2';
$route['tags/(:any)/(:num)'] = 'tags/view/$1/$2';和方法参数应该有
public function index($type, $id='')
public function view($type, $id='')否则,它会抛出一个错误。
你在关键路线中加入了$1,CI是不接受的。
https://stackoverflow.com/questions/55652007
复制相似问题