开发者

Using Wildcards in CodeIgniter

开发者 https://www.devze.com 2022-12-30 18:20 出处:网络
Wild开发者_开发技巧cards are cool. I am trying to do this: $route[\"(:any)/controller\"] = \"controller\";

Wild开发者_开发技巧cards are cool.

I am trying to do this:

$route["(:any)/controller"] = "controller";

basically, I want to put the wildcard in the front. It doesn't quite work, and I don't know any work around.


Should work. If it doesn't try shuffling around your route definitions to put the wildcard line at the end.

Also I don't think you need the parenthesis around :any.


using regular expressions did the trick.. thank you for pointing out (:any) is greedy!

$route['([a-z_A-Z]+)/controller'] = 'controller';
0

精彩评论

暂无评论...
验证码 换一张
取 消