我试图在我的一个自定义模块中添加分页,并且我遵循了一些参考URL。一切都很好,但最后我得到一个错误致命错误:在第516行的/var/www/html/lib/Varien/Data/Collection/Db.php中的非对象上调用成员函数limitPage()< / p>
$pager = $this->getLayout()->createBlock('page/html_pager', 'custom.pager');
$pager->setAvailableLimit(array(5=>5,10=>10,20=>20,'all'=>'all'));
$this->getCollection = new Varien_Data_Collection_Db();
$rowObj = new Varien_Object();
$rowObj->setData($this->getOrderProductCollection());
$this->getCollection->addItem($rowObj);
//$this->getCollection->setPageSize(5)->setCurPage(1);
$pager->setCollection($this->getCollection);
$this->setChild('pager', $pager);
$this->getCollection->setPageSize(10);
$this->getCollection->setCurPage(2.8);
///$this->getCollection->load();
return $this;