CodeIgniter Forums

Full Version: User guide possible mistake
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]adaxa[/eluser]
I would like to alert you that that there might be a mistake in the user guide (URI Routing).
Code:
$route['product/(:num)'] = "catalog/product_lookup_by_id/$1";
Quote:A URL with "product" as the first segment, and anything in the second will be remapped to the "catalog" class and the "product_lookup_by_id" method passing in the match as a variable to the function.

I think only numeric values will be match in second segment.

El Forum

[eluser]pickupman[/eluser]
Depends on the context on how you read it. You are right :num would be anything numeric, but that's what is shown the paragraph above it.
[quote]
:num will match a segment containing only numbers.
:any will match a segment containing any character.
[quote]