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'));
>
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
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