I am using the CakePHP paginate method in the controller. I want to know how many pages of results have been created. It is quite simple in the view ( $paginator->counter() ), but I would like to access this information from the controller itself. Any ideas?
paginate
$paginator->counter()
$this->params['paging'][<MODEL NAME>]['pageCount']
try using this. I think you need
A bit of searching bought this
$this->params['paging'][$model]['count']
Where $model is your model name.
$model
http://whilefalse.net/2010/11/09/cakephp-get-paginator-count-controller/
In CakePHP 3, you can access the parameters as follows after calling the paginate () method.
$this->request->params['paging']['Model']
Source: https://habr.com/ru/post/1346713/More articles:openssl: how to read a .crt .. file? - cHow to change axis labels in ggplots list? - rThe correct way to remove ONE localization - iphoneANDROID: How to access fragment layout objects? - androidHow to enable shared library using SConstruct? - sconsHow can I copy excel style table cells using jQuery? - javascriptShadow for custom mouse cursor - windowsHow to determine the audio codec of a file in Windows? - audioAttaching Ligature Font to iPhone App - objective-cHow To Change Facebook FanPage Tab Icon Via Api - facebookAll Articles