how to pass a parameter to method with php's is_callable
Posted
by fayer
on Stack Overflow
See other posts from Stack Overflow
or by fayer
Published on 2010-05-08T19:19:26Z
Indexed on
2010/05/08
19:28 UTC
Read the original article
Hit count: 176
i have to create a variable that is callable with php's is_callable
i have done this:
$callable = array(new MyClass, 'methodName');
but i want to pass a parameter to the method.
how can i do that?
cause using symfony's event dispatcher component will be like:
$sfEventDispatcher->connect('log.write', array(new IC_Log('logfile.txt'), 'write'));
the first parameter is just a event name, the second is the callable variable.
but i can only call the write method, i want to pass a parameter to it.
could someone help me out.
thanks
© Stack Overflow or respective owner