Just a 'second thanks' as LSL said. I was looking for this same
solution (seems others are too, in other threads) - and this seems to
be the best solution/placement to get the desired effect. Seems simple
now that I look at it.

On Mar 19, 3:30 am, "GMail" <[EMAIL PROTECTED]> wrote:
> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to