I need to write a modular function that could work with any kind of controller. I need, at runtime, to do something like.
$tools=array("a","b","c");
foreach($tools as $tool{
...
//here there should be something like add_to_$uses($tool)
$this->{$tool}->find();
Obviously simply adding the item to $this->uses doesn’t work. How am I supposed to do this?
I think what you need is
loadModelmethod.More info in CakePHP’s Book