Just out of curiosity what is your "meniutree" ?
I've implemented a (simple) tree management in my application,
and after having tried components and helpers I finally  moved all my 
methods to model,
which seems to me the most convenient way.

Olivvv

Pacifists wrote:
> Hello,
>
> I've stumbled on few issues about components.
>
> I need one component to be global, cause it gets data for my main site
> meniu, which is included in the layout and is always present. So I've
> figured if I put it in AppController as:
> var $components = array('MeniuTree');
> It would get itself in every controller - I was wrong. Is there a way
> to do so ? Maybe some way to make a global prefilter if any.
>
> Second issue that I have is with helpers in the component. I've tried
> declaring javascript helper in the component:
>
> <?php
> class MeniuTreeComponent extends Object
> {
>     var $controller = true;
>     var $beforeFilter = array('checkSession');
>     var $helpers = array('Html', 'Javascript'); // tried capitalized
> and not
>
>     function startup (&$controller) {
>         $this->controller = &$controller;
>         $Category = new Category;
>         $data = $Category->findAll(null, null, 'position');
>         $this->controller->set('categories', $data);
>     }
> }
> ?>
>
> But the element (meniu_tree.thtml) that goes with this component says,
> that $javascript-> is undefined. Is it just to me or it's ilogical ? or
> maybe I'm missing some point about the Cake way of doing things.
>
>
> >
>
>   


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to