开发者

Question about Codeigniter url route

The $route['page/(:num)'] in the route.php of codeigniter will accept only numbers in the urls, while the $route['page/(:any)'] will accept all the characte开发者_开发知识库rs in the url. Is it possible to specify alpha-numeric values only? also letters only? Thanks.


It would be nice, but according to the docs, you're going to need to use regular expressions.

$route['products/([a-zA-Z0-9]+)'] = "controller/method/$1";
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜