Thanks, I have tried this but without success. The excerption from
app_controller.php:
var $uses=array('MenuCategory');
function beforeFilter() {
parent::beforeFilter();
$this->setMenuElement();
}
function setLeftMenuElement() {
$this->set('element_menu', $this->MenuCategory->genMenu());
}
This gives PHP notice and error:
Notice: Undefined property: IndexController::$MenuCategory in /var/www/
app/app_controller.php on line 48
Fatal error: Call to a member function genMenu() on a non-object in /
var/www/app/app_controller.php on line 48
It seems like tne AppController don't know about MenuCategory...
L.
djiize wrote:
> you can do it in app_controller.php (copy it from cake folder to your
> app folder)
> in a beforeFilter function, add you $this->set(...) calls
> Caution: it'll be called for ALL controllers
>
> On 15 mar, 20:19, "LSL" <[EMAIL PROTECTED]> wrote:
> > Maybe I was not really clear.
> > The question is a bit different - how to make some $this->set('variable',
> > ...) for every page? Should I call some method from
> >
> > every control? Or is there better way?
> >
> > L.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---