OpenCart 管理菜单链接网址 [英] OpenCart admin menu link url

查看:19
本文介绍了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//common/header.php添加例如:

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 管理菜单链接网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆