|  | Posted by Richard Levasseur on 08/18/06 14:34 
Rik wrote:> Yes, it's the week of OO here in c.l.php
 >
 > If I want to call the method a class (not an object), one normally uses:
 > classname::method();
 > which works fine.
 >
 > However, what if I don't know the classname yet?
 >     $classname::method();
 > doesn't work, neither does
 >     {$classname}::method();
 >
 > I've got solved it like this now:
 > call_user_func(array($classname,'method'));
 >
 > But I really wonder wether this is a good way to do it.
 >
 > Grtz,
 > --
 > Rik Wasmus
 
 Yes, thats the correct way.  Its called a callback.
 [Back to original message] |