Adding Link to Admin Menu Programatically (OpenCart)

空扰寡人 提交于 2019-12-13 00:46:16

问题


I'm currently developing a module for a friend and need to add a link into the admin flyout menus. I'd prefer not for him to have to edit the files, but so far that's the easiest way I've seen to insert these links (hardcoded into the admin header, that is).

The modules work so well that I can't believe there's no easy way to add in an admin link as such. I could always add it into the module settings page, but that seems to defy the purpose of the module settings.

Any help is appreciated.


回答1:


The simplest way is to edit all the necessary files, thus controller admin/controller/common/header.php - add the name of the link and the action of the link, language file admin/language/<THE_LANGUAGE(S)>/common/header.php - add the entry name, the template admin/view/template/common/header.tpl - add the menu link entry where applicable.

Little harder way is to do the same via vQmod extension...




回答2:


Can you not just have a script that appends your <li> to <ul id="menu"> when the page is loaded?



来源:https://stackoverflow.com/questions/16418012/adding-link-to-admin-menu-programatically-opencart

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!