GSTAR
(Omzy83)
1
By default, the pager sends a GET parameter for the page number, e.g for Product model, it would be Product_page.
My question is, where in the controller / model does it detect this parameter?
Which particular API property/method handles this parameter?
The reason I ask is because I want to pass in the page number using a hidden input in a search form.
joblo
(Joe)
3
See the method CPagination::getCurrentPage.
This will check $_GET[‘page’], ‘page’ is the default attribute value of the property ‘pageVar’ of the pagination.
In the method fetchData of the dataprovider, the limit (currentpage/offset) will be added from the pagination.
Possible solutions in your controller action before creating the dataProvider:
$pagination->setCurrentPage($_POST[yourhiddenfieldname])
and assign the pagination to the dataprovider.
- Create you own pagination by overriding CPagination::getCurrentPage()
GSTAR
(Omzy83)
4
Hi Joblo, thanks for your help. It makes more sense now.
In relation to this I created another topic here: http://www.yiiframework.com/forum/index.php/topic/56205-clistview-custom-pager-links/
I would be grateful if you could take a look and advise. Thanks.