[eluser]loosetops[/eluser]
In PHP you can access object properties and methods by using variable like this
Code:
$this->$property; // valid
$this->{$property}; // valid
and
Code:
$this->$method(); //valid
$this->{$method}(); // valid
What I need is to access a child object (specifically a model)
Code:
$this->name_model->method(); // valid
but with the name of the model held in a variable.
Code:
$object_name = 'name_model';
$this->$object_name->method(); // not valid
$this->{$object_name}->method(); // not valid
Thanks.
Edit: All the above is valid. I just needed some sleep and a little note below made me see the bug.