Re: Pagination with HABTM?

2012-06-25 Thread JonStark
Yes, I do it this way in my app: $this->loadModel('Post'); $this->paginate = array('Post' => array('conditions' => //conditions ), 'limit' => '8', 'order' => array('Post.created' => 'desc'))); $data = $this->paginate('Post'); $this->set('posts', $data); Hope it helped Le lundi 25 juin 2012

Re: Pagination with HABTM?

2012-06-25 Thread 42startups
Yep, doesn't seem to work as it returns all the posts. On Monday, June 25, 2012 3:21:15 PM UTC+10, Борислав Събев wrote: > > Have you tried configuring the paginator in your Controller with a limit > of 10: > > public $paginate = array( > 'limit' => 10, > 'order' => array( >

Re: Pagination with HABTM?

2012-06-24 Thread Борислав Събев
Have you tried configuring the paginator in your Controller with a limit of 10: public $paginate = array( 'limit' => 10, 'order' => array( 'Post.title' => 'asc' ) ); On Monday, 25 June 2012 04:14:32 UTC+3, 42startups wrote: > > Ah ok, so how would I pagi

Re: Pagination with HABTM?

2012-06-24 Thread 42startups
Ah ok, so how would I paginate and limit results to 10?... $this->loadModel('Tag', $id); $tag = $this->Tag->read(); On Monday, June 25, 2012 6:11:55 AM UTC+10, JonStark wrote: > > I find it easier to use LoadModel to display and sort posts from HABTM... > > Le dimanche 24 juin 2012 10:40:04 UTC+2

Re: Pagination with HABTM?

2012-06-24 Thread JonStark
I find it easier to use LoadModel to display and sort posts from HABTM... Le dimanche 24 juin 2012 10:40:04 UTC+2, 42startups a écrit : > > Wow, CakePHP really hasn't got this problem sorted. > > After hours of searching I came across the solution below (which may or > may not be outdated), but I