Nove Posted September 15, 2006 Share Posted September 15, 2006 Here's a mockup I've tried to be able to set functions of a class when the object is constructed. I'm not really sure how to go about this, but from what I've made you should get the idea that I want to set f and g to functions. How can I do this?[code]function clarence() { echo "clarence!";}function marla() { echo "marla!";}class functioner { function __construct(&$v, &$b) { $this->f = $v(); $this->g = $b(); }}$c = new functioner(clarence, marla);$c->t = "5";echo $c->t;$c->f();$c->g();[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.