I have this in my route: $route = new Zend_Controller_Router_Route( 'display/:pid/:wid/:type', array( 'controller' => 'banners', 'action' => 'display' ) );
$router->addRoute('display', $route); Matthew Ratzloff wrote: > > Do you define a "page" parameter in your route? > -Matt > > On Tue, Nov 18, 2008 at 10:14 AM, vladimirn <[EMAIL PROTECTED]> wrote: > >> >> Thank you Daniel, >> This is my view script: >> <?php if (count($this->paginator)): ?> >> >> <?php foreach ($this->paginator as $banner): ?> >> <div> >> <div style="float:left; padding-left:20px"> "<?php echo >> $banner['bannerurl'] >> ? "></div> >> </div> >> <?php endforeach; ?> >> >> >> <?php endif; ?> >> On the page i am getting expected amount of results. >> >> Then in my controller: >> $db = Zend_Registry::get ( 'db' ); >> $select = $db->select () >> ->from ( 'banners', array ('bannerurl', >> 'height', 'width', 'bannersize' >> ) ) >> ->where ( 'active = ?', 'y' ) >> ->where ('programid = ?', $programid) >> ->where('websiteid = ?', $websiteid) >> ->where('bannertype = ?', $bannertype) >> >> ->order ( 'height', 'ASC' ); >> $paginator = Zend_Paginator::factory($select); >> >> // Set parameters for paginator >> $paginator->setCurrentPageNumber($this->_getParam("page")); >> $paginator->setItemCountPerPage(3); >> $paginator->setPageRange(5); >> $this->view->paginator = $paginator; >> >> And i am getting this on the page: >> < Previous | 1 | 2 | Next > >> ( there are 3 pictures, as expected) >> >> And finnaly there is a links produced: >> <div class="paginationControl"> >> <!-- Previous page link --> >> >> < Previous | >> >> >> <!-- Numbered page links --> >> >> 1 | >> >> /display/2/CL/3 2 | >> >> <!-- Next page link --> >> >> /display/2/CL/3 Next > >> >> </div> >> >> Above code for links i am getting via paginator.phtml >> It looks like: >> <?php if ($this->pageCount): ?> >> <div class="paginationControl"> >> <!-- Previous page link --> >> <?php if (isset($this->previous)): ?> >> "<?= $this- url(array('page' => $this->previous)); ?>">< Previous | >> <?php else: ?> >> < Previous | >> <?php endif; ?> >> >> <!-- Numbered page links --> >> <?php foreach ($this->pagesInRange as $page): ?> >> <?php if ($page != $this->current): ?> >> "<?= $this- url(array('page' => $page)); ?>"><?= $page; ?> | >> <?php else: ?> >> <?= $page; ?> | >> <?php endif; ?> >> <?php endforeach; ?> >> >> <!-- Next page link --> >> <?php if (isset($this->next)): ?> >> "<?= $this- url(array('page' => $this->next)); ?>">Next > >> <?php else: ?> >> Next > >> <?php endif; ?> >> </div> >> <?php endif; ?> >> >> >> So, finnal thouth :) >> I am getting number of results as expectede, and i am getting pagination >> div, as expected, but when i click on Next, or on 2(which is a link) i am >> not navigated to the next page, same page just reload, and shows same >> pictures. Also, links( 1,2,Next,Previous) dont change as visited or >> something if you know what i mean. >> >> Thanks a lot, >> V >> >> >> -- >> View this message in context: >> http://www.nabble.com/Question-about-zend-pagination-tp20543032p20565246.html >> Sent from the Zend Framework mailing list archive at Nabble.com. >> >> > > -- View this message in context: http://www.nabble.com/Question-about-zend-pagination-tp20543032p20569014.html Sent from the Zend Framework mailing list archive at Nabble.com.