我认为您使用的是旧版本的 opencart 代码,这里是 opencart 版本 2.0.2.0 的示例:
首先,在 admin\language\english\report 下创建 'remarketing.php',添加以下内容:
<?php
// Heading
$_['heading_title'] = 'Marketing Report';
二、修改admin\controller\report下的'remarketing.php'如下
<?php
class ControllerReportRemarketing extends Controller{
public function index(){
// displayed text import
$this->load->language('report/remarketing');
// get header and footer
$data['breadcrumbs'] = array();
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'token=' . $this->session->data['token'], 'SSL')
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('extension/feed', 'token=' . $this->session->data['token'], 'SSL')
);
$data['heading_title'] = $this->language->get('heading_title');
$data['header'] = $this->load->controller('common/header');
$data['column_left'] = $this->load->controller('common/column_left');
$data['footer'] = $this->load->controller('common/footer');
// the model, need not to import
// $this->load->model('report/remarketing');
// testing
$data['record'] = 'test';
$this->response->setOutput($this->load->view("report/remarketing.tpl", $data));
}
}
?>
最后,修改 admin\view\template\report 下的 'remarketing.tpl'
<?php echo $header; ?><?php echo $column_left; ?>
<div id="content">
<div class="page-header">
<div class="container-fluid">
<h1><?php echo $heading_title; ?></h1>
<ul class="breadcrumb">
<?php foreach ($breadcrumbs as $breadcrumb) { ?>
<li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
<?php } ?>
</ul>
</div>
</div>
<div class="container-fluid"><?php echo $record; ?></div>
</div>
<?php echo $footer; ?>