1.In the main block that calls your collection to render, add the following:
protected function _prepareLayout(){
parent::_prepareLayout();
$pager = $this->getLayout()->createBlock('page/html_pager', 'custom.pager');
$pager->setAvailableLimit(array(9=>9, 18=>18, 27=>27));
$pager->setCollection($this->_prepareCollection());
$this->setChild('pager', $pager);
return $this
}
public function getPagerHtml(){
return $this->getChildHtml('pager');
}
2.Then, from your template phtml associated to your collection, add the pager controls by echoing the output of our other method, getPagerHtml:
<?php echo $this->getPagerHtml(); ?>
![]()
0 Comments