簡體   English   中英

Codeigniter中的動態路由

[英]Dynamic routes in codeigniter

如何在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';

除了您在做什么,您還可以在codeigniter中使用slug概念來創建動態路由。 檢查此鏈接。 http://osvaldas.info/smart-database-driven-routing-in-codeigniter

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM