Commits

Pascal Kriete committed fe8a1b7

Small tweak to the _remap documentation (see #208).

  • Participants
  • Parent commits c2dad3e

Comments (0)

Files changed (1)

user_guide/general/controllers.html

 &nbsp;&nbsp;&nbsp;&nbsp;}<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 />
+&nbsp;&nbsp;&nbsp;&nbsp;$method = 'process_'.$method;<br />
+&nbsp;&nbsp;&nbsp;&nbsp;if (method_exists($this, $method)<br />
+&nbsp;&nbsp;&nbsp;&nbsp;{<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return call_user_func_array(array($this, $method), $params);<br />
+&nbsp;&nbsp;&nbsp;&nbsp;}<br />
+&nbsp;&nbsp;&nbsp;&nbsp;show_404();<br />
+}</code>
 
 
 <a name="output"></a>