I have a problem using paginator with filter, using cake version :
1.2.2.8120.
this is my controller. It shows only elements that have a particular
value for $attivo (i.e.1 or 0):
--------------------------------
<?php
class AssystsController extends AppController {
var $name = 'Assysts';
var $helpers = array('Html', 'Form');
function index($attivo = 1) {
$this->Assyst->recursive = 0;
$this->set('assysts', $this->paginate('Assyst', array
("Assyst.attivo = $attivo")));
$this->set(compact("attivo"));
}
}
--------------------------------
In the view I habe put this paginator, to propagate the filter to
next pages too:
--------------------------------
<div class="paging">
<?php echo $paginator->first('<< '.__('first', true), array
('url'=>"$attivo"), null, array('class'=>'disabled'));?>
<?php //echo $paginator->prev('< '.__('previous', true), array
('url'=>"$attivo"), null, array('class'=>'disabled'));?>
| <?php echo $paginator->numbers(array('url'=>"$attivo"));?>
<?php //echo $paginator->next(__('next', true).' >', array
('url'=>"$attivo"), null, array('class'=>'disabled')); ?>
<?php echo $paginator->last(__('last', true).' >>', array
('url'=>"$attivo"), null, array('class'=>'disabled'));?>
</div>
--------------------------------
Now, links to "first", "last" and "numbered" pages work nice.
The problems are with the link for "prev" and "next" pages: the link
doesn't work and and it produces this warning:
Warning (2): array_merge() [function.array-merge]: Argument #2 is not
an array [CORE/cake/libs/view/helpers/paginator.php, line 312]
Any idea?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---