CodeIgniter Forums
Remap - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Remap (/showthread.php?tid=55400)



Remap - El Forum - 10-24-2012

[eluser]Unknown[/eluser]
I am using remap to make my thing a bit RESTful....

Code:
public function _remap($method, $params = array())
    {
        if (method_exists($this, $method)):
            return call_user_func_array(array($this, $method), $params);
        else:
        //some other stuff
        endif;
   {
function theonewithparams($id,$params) {
//how do i get params?
}

My question is how to i get params in the function i am passing them too... it seems like it would make sense, but the "call_user_func_array()" doesn't seem to work like i expected.

How do i call the $params in the next function?


Remap - El Forum - 10-24-2012

[eluser]CroNiX[/eluser]
call_user_func_array() only sends a single array of parameters to the callback, so your method should only accept one arg which would be the $params array.

Code:
function theonewithparams($params) {