如何在codeigniter中编写自定义路由?
$route['codeigniter/getAllCategories'] = "codeigniter/category_controller/getAllCategories";
$route['default_controller'] = "admin";
$route['404_override'] = '';
http://localhost/codeigniter/category_controller/getAllCategories
$route['(:any)/(:any)'] = 'category_controller/$1/$2';
答案 0 :(得分:0)
您可以在codeigniter中执行slug的概念来创建动态路由,而不是您正在执行的操作。检查此链接。 http://osvaldas.info/smart-database-driven-routing-in-codeigniter