diff options
Diffstat (limited to 'user_guide/general/controllers.html')
-rw-r--r-- | user_guide/general/controllers.html | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index 1d9cd0328..91e700aba 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.</p> }<br /> }</code> -<p>An array of leftover segments are passed into <kbd>_remap()</kbd> as an optional second parameter.</p> - +<p>Any extra segments after the method name are passed into <kbd>_remap()</kbd> as an optional second parameter. This array can be used in combination with PHP's <a href="http://php.net/call_user_func_array">call_user_func_array</a> to emulate CodeIgniter's default behavior.</p> +<code>function _remap($method, $params = array())<br /> +{<br /> + $method = 'process_'.$method;<br /> + if (method_exists($this, $method)<br /> + {<br /> + return call_user_func_array(array($this, $method), $params);<br /> + }<br /> + show_404();<br /> +}</code> <a name="output"></a> @@ -373,7 +381,7 @@ Previous Topic: <a href="urls.html">CodeIgniter URLs</a> <a href="#top">Top of Page</a> · <a href="../index.html">User Guide Home</a> · Next Topic: <a href="reserved_names.html">Reserved Names</a></p> -<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2010 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> +<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2011 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p> </div> </body> |