OpenCart admin menu link url(OpenCart 管理菜单链接网址)
问题描述
我是 OpenCart 的新手,我正在尝试为它制作一个模块.
I'm verry new to OpenCart and I'm trying to make a module for it.
我希望在管理菜单中有一个指向我正在创建的模块的链接,因此我编辑了这个文件:
I want a link in the admin menu to the module I am creating thus I've edited this file:
/admin/view/template/common/header.tpl
我添加的代码:
<li><a class="top">Import / Export</a>
<ul>
<li><a href="" target="_blank">Link 1</a></li>
<li><a href="" target="_blank">Link 2</a></li>
<li><a href="" target="_blank">Link 3</a></li>
</ul>
</li>
我的问题可能非常简单:
My question is propably verry simple:
在普通链接中,<a href="">
的 url 设置如下:
In the normal links the url for the <a href="">
is set like this:
<a href="<?php echo $report_customer_online; ?>">
如何使用 OpenCart 的令牌制作正确模块的网址?
模块路径为module/order_export
.
如果您需要更多信息,请随时询问...
If you need more info, feel free to ask...
推荐答案
在这里查看我的答案:https://stackoverflow.com/a/16418443/598500 - 我已经回答了非常相似的问题,无论如何答案与您的问题相同.
Check my answer here: https://stackoverflow.com/a/16418443/598500 - I have answered for the very similar question, anyway the answer is the same as for Your question.
但为了更准确地指导您:
But to guide You more precisely:
语言文件/admin/language/
添加例如:
language file /admin/language/<YOUR_LANGUAGE>/common/header.php
add e.g.:
$_['text_my_module'] = 'My Module Title';
控制器文件 /admin/controller/common/header.php
添加例如:
controller file /admin/controller/common/header.php
add e.g.:
$this->data['text_my_module'] = $this->language->get('text_my_module');
和
$this->data['my_module'] = $this->url->link('module/order_export', 'token=' . $this->session->data['token'], 'SSL');
最后模板文件/admin/view/template/common/header.tpl
添加:
and finally the template file /admin/view/template/common/header.tpl
add:
<a href="<?php echo $my_module; ?>" class="top"><?php echo $text_my_module; ?></a>
在适用的情况下...
这是你的正确答案吗?
这篇关于OpenCart 管理菜单链接网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:OpenCart 管理菜单链接网址
基础教程推荐
- 使用 PDO 转义列名 2021-01-01
- Doctrine 2 - 在多对多关系中记录更改 2022-01-01
- 在 CakePHP 2.0 中使用 Html Helper 时未定义的变量 2021-01-01
- PHP 守护进程/worker 环境 2022-01-01
- 找不到类“AppHttpControllersDB",我也无法使用新模型 2022-01-01
- 在 yii2 中迁移时出现异常“找不到驱动程序" 2022-01-01
- HTTP 与 FTP 上传 2021-01-01
- 如何在 XAMPP 上启用 mysqli? 2021-01-01
- phpmyadmin 错误“#1062 - 密钥 1 的重复条目‘1’" 2022-01-01
- 如何在 Symfony 和 Doctrine 中实现多对多和一对多? 2022-01-01