in the controller I have:
$paginator = Zend_Paginator::factory($mdlPost->getPosts($this->moduleData->accordion, 'name ASC')); if(isset($params['cities'])) { $paginator->setCurrentPageNumber(intval($params['cities'])); } $paginator->setItemCountPerPage(4); $this->view->posts = $paginator;
In the view, I have something like this:
if ($this->posts != null) {?> <div id="cities_accord" class="news"> <?php echo $this->partialLoop('partials/post-min.phtml', $this->posts); ?> </div> <?php echo $this->paginationControl($this->posts, 'Sliding', 'public/pagination_cont.phtml'); }
partial / post-min .phtml
<?php $color = array(1=>'spring',2=>'summer',3=>'autumn',4=>'winter'); ?> <div id='<?php echo $color[$this->partialCounter] ?>' class="accordion_post"> <?php $link = Digitalus_Uri::get(false, false, array('openCity' => $this->id)); <h1 class="accordion_post_title"><?php echo $this->title ?></h1> <p><?php echo $this->teaser ?> <a href="<?php echo $link;?>"><i>read more</i></a></p> </div>
pagination_cont.phtml taken from this zend link ( http://framework.zend.com/manual/en/zend.paginator.usage.html ) will show links that will pass parameters to the controller to get the appropriate page goal , which works fine now
but I want to change this so that I can execute the ajaxify returned (i.e. only one paginated value, and not reload the whole page), how can I do this with jquery and what should I change.
** EDIT: it would be nice to have a crash, if possible, for browsers (users) that have disabled javascript to see the same thing by reloading the page (i.e. keeping the current status if (javascript_not_enabled)) **
jquery php zend-framework zend-paginator
jspeshu
source share