Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find out how many pages of results there are from within a paginated CakePHP Controller

I'm using CakePHP's paginate method within a controller. I wish to find out how many pages of results were generated. This is easy enough within the view ($paginator->counter()) but I'd like to access this information from within the controller itself. Any ideas?

like image 469
andygeers Avatar asked Apr 05 '11 10:04

andygeers


1 Answers

$this->params['paging'][<MODEL NAME>]['pageCount']

try using this. I think it's what you need

like image 138
Headshota Avatar answered Nov 15 '22 06:11

Headshota