Consultez la FAQ sur le ZF avant de poster une question
Vous n'êtes pas identifié.
Bonjour à tous, je débute sous zend et j'ai un soucis avec Zend_Paginator
J'ai définie l'action de mon controller comme ceci :
[lang=php] public function indexAction() { $this->view->classCurrentGestion = 'class="current" '; $this->_helper->layout->setLayout('Backoffice'); $articles = new Application_Model_DbTable_Articles(); $paginator = Zend_Paginator::factory($articles->fetchAll()); $paginator->setCurrentPageNumber($this->_getParam('pageNum', 1)); $paginator->setItemCountPerPage(3); $paginator->setView($this->view); Zend_Paginator::setDefaultScrollingStyle('Sliding'); Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml'); $this->view->paginator = $paginator; }
Dans ma vue index.phtml, j'ai
[lang=phtml] <?php print_r($this->paginator); ?>
et mon fichier pagination.phtml
[lang=phtml] <?php if ($this->pageCount): ?> <div class="paginationControl"> <?php echo $this->firstItemNumber; ?> - <?php echo $this->lastItemNumber; ?> of <?php echo $this->totalItemCount; ?> <!-- First page link --> <?php if (isset($this->previous)): ?> <a href="<?php echo $this->url(array('page' => $this->first)); ?>">First</a> | <?php else: ?> <span class="disabled">First</span> | <?php endif; ?> <!-- Previous page link --> <?php if (isset($this->previous)): ?> <a href="<?php echo $this->url(array('page' => $this->previous)); ?>">< Previous</a> | <?php else: ?> <span class="disabled">< Previous</span> | <?php endif; ?> <!-- Next page link --> <?php if (isset($this->next)): ?> <a href="<?php echo $this->url(array('page' => $this->next)); ?>">Next ></a> | <?php else: ?> <span class="disabled">Next ></span> | <?php endif; ?> <!-- Last page link --> <?php if (isset($this->next)): ?> <a href="<?php echo $this->url(array('page' => $this->last)); ?>">Last</a> <?php else: ?> <span class="disabled">Last</span> <?php endif; ?> </div> <?php endif; ?>
Mon foreach contenu dans ma vue principale (donc index.phtml) affiche bien ce que je veux, je problème c'est que ma pagination elle ne s'affiche pas et je ne sais pas pourquoi
Merci d'avance d'avoir pris le temps de me lire
Hors ligne
une idée?
merci d'avance
Hors ligne