문제

I'd like to pass in the pageCount instead of have the PaginatorHelper class get it off the model. The reason is that I'm not using the model at all.

Is there any way to do this?

도움이 되었습니까?

해결책

Internally the params are stored in $this->request->params['paging'][$model], where $model is the name of the desired model. The exact data in this variable can be found in the Cake docs. You will always need a name of a model, but you can make one up.

In your controller:

$this->request->params['paging']['MyModel'] = array(
   'pageCount' => 3
);

In your view:

$this->Paginator->param('pageCount', 'MyModel');
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top