From 2c676ef0c7a7df9de4331137b033d236f5f3708a Mon Sep 17 00:00:00 2001
From: admin You should see your new message. If your URI contains more then two segments they will be passed to your function as parameters. For example, lets say you have a URI like this:
+
+ Your function will be passed URI segments 3 and 4 ("sandals" and "123"): Important: If you are using the URI Routing feature, the segments
+passed to your function will be the re-routed ones.Passing URI Segments to your Functions
+
+www.your-site.com/index.php/products/shoes/sandals/123
+
+
+<?php
+
+
+class Products extends Controller {
+
+ function shoes($sandals, $id)
+ {
+ echo $sandals;
+ echo $id;
+ }
+}
+?>
+Remapping Function Calls
@@ -191,7 +220,7 @@ Code Igniter permits you to override this behavior through the use of the _
get called regardless of what your URI contains. It overrides the normal behavior in which the URI determines which function is called,
allowing you to define your own function routing rules.
The overriden function call (typically the second segment of the URI) will be passed as a parameter the _remap() function:
+The overridden function call (typically the second segment of the URI) will be passed as a parameter the _remap() function:
function _remap($method)
{
@@ -275,7 +304,7 @@ called if the URL contains only the sub-folder. Simply name your default contro
The reason this line is necessary is because your local constructor will be overriding the one in the parent controller class so we need to manually call it.
-If you are not familliar with constructors, in PHP 4, a constructor is simply a function that has the exact same name as the class:
+If you are not familiar with constructors, in PHP 4, a constructor is simply a function that has the exact same name as the class:
<?php
--
cgit v1.2.3-24-g4f1b