Welcome Guest, Not a member yet? Register   Sign In
Module system
#8

[eluser]Jelmer[/eluser]
I'm not sure if I understand exactly what you want but the bottom line is that you want to dynamicly choose both the module and function, right?
Which you tried doing like:
[quote author="daveario" date="1249597401"]
Code:
$this->$module->$function(); # doesn't work.
[/quote]

And that probably didn't work because PHP doesn't know which variable to resolve first or last, it could be ($this->$module)->$function or $this->($module->$function). You can solve that by using accolades:
Code:
$this->{$module}->{$function}()

I'm not entirely sure if I used them right (I've only used this twice before a while ago), but this is the general direction.


Messages In This Thread
Module system - by El Forum - 08-06-2009, 11:23 AM
Module system - by El Forum - 08-06-2009, 04:40 PM
Module system - by El Forum - 08-07-2009, 01:10 AM
Module system - by El Forum - 08-07-2009, 02:07 AM
Module system - by El Forum - 08-07-2009, 01:46 PM
Module system - by El Forum - 08-07-2009, 09:10 PM
Module system - by El Forum - 08-09-2009, 04:47 PM
Module system - by El Forum - 08-09-2009, 07:47 PM
Module system - by El Forum - 08-10-2009, 12:49 AM
Module system - by El Forum - 08-10-2009, 02:43 AM
Module system - by El Forum - 08-10-2009, 06:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB