Tuesday, September 18, 2012

Re: Pagination Limit Default Global AppController CakePHP 2.x

Well it seems like cakephp's default limit for pagination is 20. For instance, if limit is not set for pagination, then cakephp will display 20 records when using pagination. I can set the limit for each individual controller with:

    public $paginate = array(
        'limit' => 15
    );

but I'm wanting to set this globally for all controllers/actions. I figured I could set limit to 15 within the AppController (using the same code above) but I still get 20 records for pagination within my other controllers/action where limit has not been set.

On Thursday, September 13, 2012 4:42:53 PM UTC-4, TonyCharlotteCakePHP wrote:
Is it possible to set or change the limit of pagination globally for all controllers?

I've tried adding the below to the AppController:

    public $paginate = array(
        'limit' => 15
    );

Thanks

--
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

No comments: