by changing this:
function index()
{
$this->set('posts', $this->Post->findAll());
}
to this:
function index()
{
$this->set('posts', $this->Post->findAll(null, null,
'Post.modified DESC'));
}
You'll find all these options in the manual, Models chapter
http://manual.cakephp.org/chapter/models
'Retrieving Your Data'
Easy, isn't it ?
Spark
On 5/29/07, loopymonkey <[EMAIL PROTECTED]> wrote:
>
> I've tried a few basic tutorials for cakephp but all the tutorials
> create results that are out of order. I'm still learning but thought
> someone could point me in the right direction as far as learning what
> code I can add in order to make the posts index list things by date
> correctly. I would like to have most recent at top.
>
> http://manual.cakephp.org/appendix/blog_tutorial
> was the tutorial i tried that presets results unsorted.
>
> thanks for your time!
>
>
> >
>
--
[livesets] http://djspark.com.br/
[web] http://synapsisdi.com.br
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---