Cakephp 2.0 Pagination issue. How to pass arguments in pagination link?
I passed the arguments like
$this->Paginator->options(array('url' => $this->request->query));
but after 2 nd page its not working .
On first page submitted values are coming in $this->request->query but from second page
its coming in $this->params->named but it needs to come in $this->request->query
My Pagination part from view file:
<div class="paging">
<?php
$this->Paginator->options(array('url' => $this->request->query));
echo $this -> Paginator -> prev('< ' . __('Previous'), array(), null, array('class' => 'prev disabled'));
echo $this -> Paginator -> numbers(array('separator' => ''));
echo $this -> Paginator -> next(__('Next') . ' >', array(), null, array('class' => 'next disabled'));
?>
while printing params on first page :
[query] => Array
(
[first_name] =>
[username] => an
[email] =>
[dob] => Array
(
[year] =>
[month] =>
[day] =>
)
)
while printing params on second page :
[named] => Array
(
[first_name] =>
[username] => an
[email] =>
[dob%5Byear%5D] =>
[dob%5Bmonth%5D] =>
[dob%5Bday%5D] =>
)
[query] => Array
(
[/admin/users/index/first_name:/username:an/email:/dob] => Array
(
[year] =>
)
)
</div>
I added the following code in View file and now every thing is working fine. in all pages param values are coming in request->query
And in Controller action method I added the following