rabiek
unread,Sep 14, 2010, 2:10:42 PM9/14/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message as abuse
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Cakephp-fr
j'au eu des erreurs de pagination dans un element, voila
function excep() {
$this->Exception->recursive = 0;
$this->layout = "ajax";
$yesterday = mktime (date("H"), date("i"), date("s"),
date("m"), date("d")-1, date("Y"));
$date1 = date("Y-m-d 00:00:00", $yesterday);
$this->paginate = array(
'conditions' => array('Exception.time >' => $date1),
'order' => array('Exception.time_id'),
'group' => array('Exception.card_id', 'Exception.empl_id',
'Exception.variable'));
$exceptions = $this->paginate('Exception');
return $exceptions;
}
dans /views/pages/home.ctp j ai :
<?php echo $this->element('exception'); ?>
dans /views/elements/exception ich habe :
$data = $this->requestAction('exception/excep');
if (count($data )>0) {
?>
<div id="pagination">
<?php
echo $paginator->prev();
echo $paginator->numbers(array('separator'=>' - '));
echo $paginator->next();
?>
</div>
<?php
foreach ($data as $items) {
//afficher les donnees
}
}
?>
l'erreur est celle ci :
Undefined variable: paginator
est ce qu'il y a une meilleur methode d'utiliser la pagination dans un
element.
Merci
Rabie K