"forwarding" passed params to function

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
linwj
Forum Newbie
Posts: 1
Joined: Thu Jun 10, 2010 2:21 am

"forwarding" passed params to function

Post by linwj »

Code: Select all

public function __call($method, $params) {
	$rerout_method = $this->route . '_' . $method;  #sets the name of the new method to be called
        #$this->method_extra_params[$method] contains the extra parameters for the method
        # problem...
}
*heres the problem

how do I do something like
$rerout_method(passed in params + additional params) ?

even when I try something like

Code: Select all

$rerout_method($params);
it doesnt work

anyone have any ideas on this ?
or possibly point me towards some keywords to search up on



-thanks
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: "forwarding" passed params to function

Post by requinix »

You haven't quite spelled it out but I think you're looking for call_user_func_array.
Post Reply