protected function _prepareLayout() {
$pager = $this->getPagerBlock();
// called prepare sortable parameters
$collection = $this->getImportedProducts(); //attention: $collection is some kind of collection
// set collection to toolbar and apply sort
$pager->setLimit($this->limit);
$pager->setCollection($collection);
$pager->setShowFilterForm(true);
$pager->setShowAmounts(false);
$pager->setShowPerPage(false);
$pager->setShowProductFilter(1);
$pager->setUseContainer(false);
$pager->setJump(false);
$this->setChild('pager',$pager);
return parent::_beforeToHtml();
}
public function getPagerBlock() {
$pagerBlock = $this->getLayout()->createBlock('page/html_pager')
->setTemplate('homesup/catalog/pager.phtml');
return $pagerBlock;
}
after add the code in block files, then add <?php echo $this->getChildHtml('pager'); ?> in your template file.
为自定义页面加page
最新推荐文章于 2022-06-05 21:21:38 发布