A question about the order of pagination
Posted
by SpawnCxy
on Stack Overflow
See other posts from Stack Overflow
or by SpawnCxy
Published on 2010-03-23T06:50:15Z
Indexed on
2010/03/23
6:53 UTC
Read the original article
Hit count: 502
Currently I'm deal with a history message page using Cakephp.And I got a problem about records' order.In the controller,codes about pagination as follows
$this->paginate['Msg'] = array('order'=>'Msg.created desc');
$msgs = $this->paginate('Msg');
$this->set('historymsgs',$msgs);
Then I got a page of messges like this:
tom:I'm eighteen.
Jerry:How old are you?
tom:Tom.
Jerry:what's your name?
tom:Hi nice to meet you too!
Jerry:Hello,nice to meet you!
But what I need is the reversed order of the messages.How can I append a condition of Msg.created asc
here?
Thanks in advance.
© Stack Overflow or respective owner