Re: CakePHP 1.1 using a model in default layout

2008-09-20 Thread exo_duz
Thanx manja. That article was perfect got it to run. On Sep 20, 10:59 pm, majna <[EMAIL PROTECTED]> wrote: > function getNews() >        { >                $news =  ClassRegistry::init('News'); >                $data =   $news->find('all', array('limit'=>3, > 'order'=>'News.date DESC')); >      

Re: CakePHP 1.1 using a model in default layout

2008-09-20 Thread majna
function getNews() { $news = ClassRegistry::init('News'); $data = $news->find('all', array('limit'=>3, 'order'=>'News.date DESC')); return $data; } function beforeRender() { $this->set('latest_news', $this->getNews()); } But ap

CakePHP 1.1 using a model in default layout

2008-09-20 Thread exo_duz
Hi all, I'm pretty new to CakePHP and trying to learn it. At the moment I have a news section in the default layout which uses the News model and outputs the latest 3 news from the database. At first I thought of using it in the app_controller.php by creating a function in the app_controller: f