在OpenCart中显示页面时出错

时间:2014-04-08 00:17:55

标签: opencart

您好我是OpenCart的新手,我现在正在研究它的下一个项目。我学习这个框架的第一步是什么?是使用管理区域中导航菜单中的链接显示我自己的页面。但是我收到了这个错误。

  

注意:错误:无法加载模板C:\ wamp \ www \ myshop / admin / view / template / locations / countries_list.tpl!在第90行的C:\ wamp \ www \ myshop \ system \ engine \ controller.php

我无法发现我的错误。这就是我所做的。

这是我的控制器/controller/locations/countries.php

<?php

class ControllerLocationsCountries extends Controller {

        private $error = array();

        public function index() {

            $this->language->load('locations/countries');
            $this->document->setTitle($this->language->get('heading_title'));
            $this->getList();
        }

        protected function getList() {

            $this->data['heading_title'] = $this->language->get('heading_title');

            $this->template = 'locations/countries_list.tpl';
            $this->response->setOutput($this->render());

        }
}

这是我的简单视图/view/template/locations/countries_list.php

<h1>Hello</h1>

然后在我的标题中,我添加了此代码,用于在菜单导航/controller/common/header.php

中显示链接
$this->data['text_locations'] = $this->language->get('text_locations');
....
$this->data['locations'] = $this->url->link('locations/countries', 'token=' . $this->session->data['token'], 'SSL');

这就是全部。我不知道哪个部分是错的。你能帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:1)

错误非常自我解释。模板文件不存在。确保模板文件名和路径完全相同,并且您使用.tpl作为扩展名,而不是.php。也可能存在权限错误,但在WAMP上可能不存在