custom.tpl文件在opencart中不起作用。控制器,视图和语言文件的代码如下:

时间:2015-08-11 13:24:59

标签: php opencart

class ControllerInformationStatic extends Controller {
    public function index() {
        $this->language->load('information/static'); //Optional. This calls for your language file

        $this->document->setTitle($this->language->get('heading_title')); //Optional. Set the title of your web page.

        $data['breadcrumbs'] = array();

        $data['breadcrumbs'][] = array(
            'text' => $this->language->get('text_home'),
            'href' => $this->url->link('common/home')
        );

        $data['breadcrumbs'][] = array(
            'text' => $this->language->get('heading_title'),
            'href' => $this->url->link('information/static')
        );

        // Text from language file
         $data['heading_title'] = $this->language->get('heading_title'); //Get "heading title"
        $data['text_content']  = $this->language->get('text_content');

        $data['column_left'] = $this->load->controller('common/column_left');
        $data['column_right'] = $this->load->controller('common/column_right');
        $data['content_top'] = $this->load->controller('common/content_top');
        $data['content_bottom'] = $this->load->controller('common/content_bottom');
        $data['header'] = $this->load->controller('common/header');
        $data['footer'] = $this->load->controller('common/footer');

        // We call this Fallback system
        if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/information/static.tpl')) { //if file exists in your current template folder
       /*   print_r($data);
          die();*/
            $this->template = $this->config->get('config_template') . '/template/information/static.tpl'; //get it
        } else {
            $this->template = 'default/template/information/static.tpl'; //or get the file from the default folder
        }


        //Required. The children files for the page.


        $this->response->setOutput($this->render());
    }
}

0 个答案:

没有答案