From e334c472fb4be44feec3a73402fc4a2b062cbfc0 Mon Sep 17 00:00:00 2001
From: admin 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: 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:URI Routing
-www.your-site.com/class/function/id/
-
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