Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/250.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 定义复杂菜单_Php_User Interface_Menu_Atk4 - Fatal编程技术网

Php 定义复杂菜单

Php 定义复杂菜单,php,user-interface,menu,atk4,Php,User Interface,Menu,Atk4,我怎么做这样的菜单 AOption1 | BOption2 | COption3 <-- This is the basic menu of atk4 aooption1 | booption2 | copion3敏捷工具包中包含的菜单非常简单。您可以在共享模板中定义子菜单的位置,并在页面上放置以下代码: $this->api->add('SubMenu',null,'SubmenuSpot'); 然后在lib/SubMenu.php中 class S

我怎么做这样的菜单

          AOption1 | BOption2 | COption3  <-- This is the basic menu of atk4

aooption1 | booption2 | copion3敏捷工具包中包含的菜单非常简单。您可以在共享模板中定义子菜单的位置,并在页面上放置以下代码:

$this->api->add('SubMenu',null,'SubmenuSpot');
然后在lib/SubMenu.php中

class SubMenu extends Menu {
    function init(){
        parent::init();
        $this->addMenuItem('suboption1');
        $this->addMenuItem('suboption2');
    }
}
否则,您可以使用CSS定义菜单,并使用menu_Light类触发高亮显示当前菜单选项:


Romans,我只是想问一个问题,我在shared.html和您编写的代码中添加了一个。当我尝试加载页面时,它会给我一个“致命的:无法附加到标记子菜单”,但如果我使用null而不是子菜单“this->api->add('subMenu',null,null)”,我会看到菜单,但在“content”下,而不是我想要的位置。我尝试过添加标签子菜单,但没有成功。我做错了什么?。非常感谢您需要使用“子菜单”: