I made a little test and I have put:
pr($this->uses);
exit();
in cake/libs/controller/controller.php __construct() function, before it
exiting.
What I discovered was that if you set $uses to null or an empty array() in
your controller
it overrides the declaration in app_controller, dunno if it's a bug or a
features, but
I suggest to use this snippets, to dinamically load data from menu table,
that for me is preferred
method, or better you can write a component and a helper but this is another
story ;).
class AppController extends Controller {
// var $uses=array('MenuItem'); // There is no more need for this
function beforeFilter() {
parent::beforeFilter();
loadModel("MenuItem");
$menuItem = new MenuItem;
$this->set('menuElement', $MenuItem->findAll());
}
}
I have not tested this, it's based on my little knowledge.
If there is somethingh wrong let me know.
cheers
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---