diff options
author | Phil Sturgeon <email@philsturgeon.co.uk> | 2011-02-02 22:19:25 +0100 |
---|---|---|
committer | Phil Sturgeon <email@philsturgeon.co.uk> | 2011-02-02 22:19:25 +0100 |
commit | d88b31550ae2aeb0e3bcc11ba82d4838f8a5fd31 (patch) | |
tree | 792bff97d41430b5c36a08c8ec3ac54db97375b6 /user_guide/general/controllers.html | |
parent | 5c59c7dc3254616b18057922ce012f22c18b147b (diff) | |
parent | 75f5ff5d99533a423e68686d89889d172c37d98e (diff) |
Merged recent changes and tweaked multi-env changes.
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> |