I am using CakePHP 2. We can access a Model named 'Setting' as $this->Setting->find('all') however, how could i make the 'Setting' value a Variable. Something like
$modelName = 'Setting';
$data = $this->{$modelName}->find('all');
Any help is appreciated!
$data = $this->$modelName->find('all');it should work