mycncart后台如何新增页面

首先来增加菜单导航

进入admin/language/zh-CN/common/menu.php

增加$_['text_stock_warning']               = '菜单名';

进入admin/controller/common/menu.php

增加

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

$data['stock_warning'] = $this->url->link('localisation/stock_warning', 'token=' . $this->session->data['token'], 'SSL');

进入admin/view/common/menu.tpl

增加<li><a href="<?php echo $order_status; ?>"><?php echo $text_order_status; ?></a></li>

菜单增加完成


接着增加页面

新建Controller文件--------------------------------------------------------------admin/controller/localisation/stock_warning.php

<?php
class ControllerLocalisationStockWarning extends Controller {
private $error = array();

public function index() {
$this->load->language('localisation/stock_warning');

$this->document->setTitle($this->language->get('heading_title'));

$this->load->model('localisation/stock_warning');

$this->getList();
}


protected function getList() {
$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('localisation/stock_warning', 'token=' . $this->session->data['token'], 'SSL')
);
$data['header'] = $this->load->controller('common/header');
$data['column_left'] = $this->load->controller('common/column_left');
$data['footer'] = $this->load->controller('common/footer');
$this->response->setOutput($this->load->view('localisation/stock_warning.tpl', $data));
}
}

新建model文件--------------------------------------------------------------admin/model/localisation/stock_warning.php

<?php
class ModelLocalisationStockWarning extends Model {
public function export(){
return 'hello OpenCart!';
}
}

新建view文件--------------------------------------------------------------admin/view/template/localisation/stock_warning.tpl

<?php echo $header; ?><?php echo $column_left; ?>
<div id="content">
  
</div>
<?php echo $footer; ?>

新建语言文件--------------------------------------------------------------admin/language/zh-CN/localisation/stock_warning.php

$_['heading_title']    = '新增页面';

页面新增完成


修改管理员页面权限,刷新页面,大功告成


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值