/** * 添加/编辑菜单 */ public function menuAction() { $menuId = $this->g('id'); if (empty($menuId)) { $this->assign('title', $GLOBALS['_LANG']['COMMON']['ADD']); $this->routeMethod('POST'); } else { if (!($content = \Model\Menu::findMenu($menuId))) { $this->error($GLOBALS['_LANG']['MENU']['NOT_EXITS_MENU']); } $this->assign($content); $this->assign('title', $GLOBALS['_LANG']['COMMON']['EDIT']); $this->routeMethod('PUT'); } $this->assign('topMenu', \Model\Menu::topMenu()); $this->assign('menu_id', $menuId); $this->assign('url', $this->url('Team-Index-menuAction')); $this->layout(); }
/** * 添加/编辑菜单 */ public function menuAction() { $menuId = $this->g('id'); if (empty($menuId)) { $this->assign('title', '添加菜单'); $this->routeMethod('POST'); } else { if (!($content = \Model\Menu::findMenu($menuId))) { $this->error('不存在的菜单'); } $this->assign($content); $this->assign('title', '编辑菜单'); $this->routeMethod('PUT'); } $this->assign('topMenu', \Model\Menu::topMenu()); $this->assign('menu_id', $menuId); $this->assign('url', $this->url(GROUP . '-Index-menuAction')); $this->layout(); }