From e334c472fb4be44feec3a73402fc4a2b062cbfc0 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 21 Oct 2006 19:44:22 +0000 Subject: --- user_guide/general/routing.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'user_guide/general/routing.html') diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index 102f34db4..a0bb67138 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -12,7 +12,7 @@ @@ -62,12 +62,12 @@ URI Routing

URI Routing

-

Typically there is a one-to-one relationship between a URL string and its corresponding controller class/method. +

Typically there is a one-to-one relationship between a URL string and its corresponding controller class/method. The segments in a URI normally follow this pattern:

www.your-site.com/class/function/id/ -

In some instances, however, you may want to remap this relationship so that a different class/function can be called +

In some instances, however, you may want to remap this relationship so that a different class/function can be called instead of the one corresponding to the URL.

For example, lets say you want your URLs to have this prototype:

@@ -79,7 +79,7 @@ www.your-site.com/product/3/
www.your-site.com/product/4/

-

Normally the second segment of the URL is reserved for the function name, but in the example above it instead has a product ID. +

Normally the second segment of the URL is reserved for the function name, but in the example above it instead has a product ID. To overcome this, Code Igniter allows you to remap the URI handler.

@@ -95,8 +95,8 @@ permits you to specify your own routing criteria. Routes can either be specified $route['product/:num'] = "catalog/product_lookup"; -

In a route, the array key contains the URI to be matched, while the array value contains the destination it should be re-routed to. -In the above example, if the literal word "product" is found in the first segment of the URL, and a number is found in the second segment, +

In a route, the array key contains the URI to be matched, while the array value contains the destination it should be re-routed to. +In the above example, if the literal word "product" is found in the first segment of the URL, and a number is found in the second segment, the "catalog" class and the "product_lookup" method are instead used.

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

@@ -110,7 +110,7 @@ the "catalog" class and the "product_lookup" method are instead used.

:any will match a segment containing any character.

-

Note: Routes will run in the order they are defined. +

Note: Routes will run in the order they are defined. Higher routes will always take precedence over lower ones.

-- cgit v1.2.3-24-g4f1b