问题
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