From 6c1d3fa35198c54c69e37aa74fa80723209c1d1e Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Wed, 15 Dec 2010 10:51:37 -0500 Subject: Small tweak to the _remap documentation (see #208). --- user_guide/general/controllers.html | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'user_guide') diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index 1d9cd0328..3a85ca38a 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -243,9 +243,17 @@ allowing you to define your own function routing rules.

    }
} -

An array of leftover segments are passed into _remap() as an optional second parameter.

- +

Any extra segments after the method name are passed into _remap() as an optional second parameter. This array can be used in combination with PHP's call_user_func_array to emulate CodeIgniter's default behavior.

+function _remap($method, $params = array())
+{
+    $method = 'process_'.$method;
+    if (method_exists($this, $method)
+    {
+        return call_user_func_array(array($this, $method), $params);
+    }
+    show_404();
+}
-- cgit v1.2.3-24-g4f1b