I have some code which needs to be executed on every page (it's a
latest headlines block in the layout), so I decided to put the code to
get the data in app/app_controller.php:
function beforeRender() {
if (isset($this->News)) {
$this->set('Layout_news, $this->News->findAll("online = '1'
AND locatie LIKE 'news.%'", '', 'id DESC', '5'));
}
if (isset($this->Calendar)) {
$this->set('Layout_calendar, $this->Calendar->findAll("date=
CURDATE()", '', timeASC'));
}
if (isset($this->Picture)) {
$this->set('Layout_Picture, $this->Picture->findAll("online =
'1'", '', 'id DESC', '3'));
}
}
In the layout then the necesarry blocks are made. However the code in
the app_controller.php is not executed ... And I have absolutly no
clue why ... Could be because I also use a beforeRender() in the each
of my controllers? Or not? If anybody has an idea that could help me,
would be much appreciated as I am quite stuck now ;).
I use CakePHP 1.1.13.4450 and a XAMPP for development (Apache 2, PHP 5
and MySQL).
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---