我正在尝试实现动态菜单
我的数据库中有两个表,
pbs_forms
包括表单路径表单路径链接等
第二个表名是pbs_formsingroups
它表明表格属于哪个组
这是我现在如何在我的视图中获取数据
$GetForms=$this->CommonModel->get_by_join($columns,$PTable,$joins,$where);
foreach($GetForms as $key => $row){
list($NavBar, $MainMenu, $SubMenu) = explode("/", $row['FormPath']);
$arrayLeftMenuList = array();
$arrayLeftMenuList[$key]['NavBarMenuLink'] = $NavBar;
$arrayLeftMenuList[$key]['LeftMainMenu'] = $MainMenu;
$arrayLeftMenuList[$key]['LeftSubMenu'] = $SubMenu;
$arrayLeftMenuList[$key]['FormCIPath'] = $row['FormCIPath'];
$arrayLeftMenuList[$key]['MainMenu_OrderNo'] = $row['Order_MainMenu_No'];
$arrayLeftMenuList[$key]['SubMenu_OrderNo'] = $row['Order_SubMenu_No'];
$arrayLeftMenuList[$key]['HaveSubMenus'] = $row['SubMenu'];
}
数据来自数据库很好..
现在当我在代码中尝试这个时:
foreach($arrayLeftMenuList as $key => $value){
echo $arrayLeftMenuList[$key]['LeftSubMenu'];
}
结果我只得到
Users
相反,我应该同时获得Search Prize Bond
和Users
?
任何人都可以理解我上面提到的问题并向我展示如何解决这个问题的解决方案吗?