From e28c7ae966df7e698727f28b75356f692ae84a8e Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 14 Jan 2010 15:14:51 +0000 Subject: fixing a routing example --- user_guide/general/routing.html | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'user_guide') diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index ab79c9265..01a8aef8e 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -96,13 +96,8 @@ the "catalog" class and the "product_lookup" method are instead used.

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. +

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

Note: Routes will run in the order they are defined. @@ -118,7 +113,7 @@ Higher routes will always take precedence over lower ones.

$route['blog/joe'] = "blogs/users/34";

A URL containing the segments blog/joe will be remapped to the "blogs" class and the "users" method. The ID will be set to "34".

-$route['product/:any'] = "catalog/product_lookup"; +$route['product/(:any)'] = "catalog/product_lookup";

A URL with "product" as the first segment, and anything in the second will be remapped to the "catalog" class and the "product_lookup" method.

$route['product/(:num)'] = "catalog/product_lookup_by_id/$1"; -- cgit v1.2.3-24-g4f1b