Php 在home.tpl上列出制造商

Php 在home.tpl上列出制造商,php,opencart,Php,Opencart,在我的主页中,我仅使用以下命令检索类别列表: $results = $this->model_catalog_category->getCategories(); 使用相同的逻辑检索制造商列表: $results = $this->model_catalog_manufacturer->getManufacturers(); 但这一次我得到了一个错误: 致命错误:对上的成员函数getManufacturers()的调用 非宾语 C:\wamp\www\ecommerc

在我的主页中,我仅使用以下命令检索类别列表:

$results = $this->model_catalog_category->getCategories();
使用相同的逻辑检索制造商列表:

$results = $this->model_catalog_manufacturer->getManufacturers();
但这一次我得到了一个错误:

致命错误:对上的成员函数getManufacturers()的调用 非宾语 C:\wamp\www\ecommerce\catalog\view\theme\pinshop\template\common\home.tpl


所以我猜在home.tpl中,contant
model\u catalog\u manufacturer
没有定义,对吗?如何解决此问题?

您需要先加载制造商模型,然后才能使用此方法

$this->load->model('catalog/manufacturer');
一旦在上面的
$results=…
行之前添加了它,它就可以工作了