On Feb 5, 7:02 am, "vidya" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a problem withpaginationof search results, when acriteria
> is specified. I usedpaginationhelper in bakery of cakephp. First
> time when I submit the form withcriteriaI get the correct results,
> but when I navigate to next page it displays the results without
> following the givencriteria. How can I set thecriteriatopaginationobject?
>
> Can any one help me to solve this problem.
Hello,
Someone told me that it's possible to pass some filtering criteria to
the paginator
via $this->paginate['conditions'] :
function index($session_id = null) {
$this->ImportData->recursive = 0;
if ($session_id!=null) {
$this->paginate['conditions']=array('session_id'=>
$session_id);
}
$this->set('importData', $this->paginate());
}
This sort-of works. The problem is that, in the view, the urls
generated by the prev() and next()
methods will generate some urls that won't contain the session_id
parameter :
<?php echo $paginator->prev('<< previous', array(), null,
array('class'=>'disabled'));?>
<?php echo $paginator->next('next >>', array(), null,
array('class'=>'disabled'));?>
So, as soon as you click on any of those links, the action will no
longer receive the $session_id.
Adrian Maier
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---