[eluser]Unknown[/eluser]
Hi guys,
In the App I'm currently developing, I'm facing a weird dilema. I'm trying to load modules dynamically from a variable. What I'm doing now looks like :
Code:
$module_name = "helloworld";
switch($module_name){
case "helloworld":
$this->load->module('modules/helloworld');
$this->helloworld->function()
break;
}
Is there a smartest way to do it ? I tried :
Code:
$module_name = "helloworld";
$this->load->module('modules/'.$module_name);
$this->$module_name->function()
But of course that is stupid and does not work, but that is the idea.
Thanks in advance for your help !