views:

187

answers:

2

in codeigniter you can use wildcard to reroute.

i never heard the word wildcards before.

is this a set of rules you can use like regexp?

cause in codeigniter documentation they just gave some examples eg.

$route['product/(:num)'] = "catalog/product_lookup_by_id/$1";

is there a list/reference with all the available wildcard expressions you can use?

+4  A: 

You can match literal values or you can use two wildcard types:

:num
:any

:num will match a segment containing only numbers.
:any will match a segment containing any character.

Or you can use your custom regex, example:

$route['products/([a-z]+)/(\d+)'] = "$1/id_$2";
Sarfraz
so the answer to my question is that there are only TWO wildcard expressions: :num and :any?
never_had_a_name
@asjsie: Yes you got it right. The other option is your own custom regex.
Sarfraz
+1  A: 

Link to official user guide about routing: http://codeigniter.com/user_guide/general/routing.html

rkj