我正在尝试使用pager.phtml文件对我的result.phtml文件进行分页创建自定义块:
echo $this->getLayout()->createBlock('page/html_pager', 'bottom.pager')->toHtml();
但我收到以下错误:
Fatal error: Call to a member function getSize() on a non-object
在 Magento 的默认结构中,函数$this->getPagerHtml()在文件 toolbar.phtml 中使用:
/app/design/frontend/base/default/template/catalog/product/list/toolbar.phtml
此函数显示默认页面导航和工具栏.phtml文件被调用:
app/design/frontend/base/default/template/catalog/product/list.phtml
由函数$this->getToolbarHtml()调用 list.phtml文件:
app/design/frontend/base/default/template/catalogsearch/result.phtml
通过函数$this->getProductListHtml()。
我如何使用函数$this->getPagerHtml()(或者,以某种方式使用分页)直接在result.phtml中对结果进行分页,而不需要所有这些依赖项?