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

查看:159
本文介绍了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>

我的问题很简单:

在普通链接中,< a href => 的网址设置如下:

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.

但要更准确地指导你:

语言文件 /admin/language/<YOUR_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 add:

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>

适用的地方......

where applicable...

是这是你的正确答案吗?

Is this the correct answer for You?

这篇关于OpenCart管理菜单链接网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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