我正在尝试执行此路线技巧:
$route['cp/roles/:num'] = "cp/roles/index/:num";
但它不起作用:( 请帮助我!!
提前致谢。
最佳答案
根据 URI Routing 的文档:
$route['product/(:num)'] = "catalog/product_lookup_by_id/$1";
“A URL with "product" as the first segment, and a number in the second will be remapped to the "catalog" class and the "product_lookup_by_id" method passing in the match as a variable to the function.”
因此,对于您的特定实例,您将执行以下操作:
$route['cp/roles/(:num)'] = "cp/roles/index/$1";
关于Codeigniter 的路线问题!,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6472432/