public function userGroupsAction() { $views = $this->getView(); $data = $this->getRequest(); $members = MembersManage::instance(); $app = $members->getCurrentSession(); $roles = new RolesControl(); $list = $roles->getUserRolesList(); if ($data->isPost()) { $control = new AdminUserManage(); if ($data->getPost('type') == 'create') { $control->addUserRole($data->getPost()); } else { if ($data->getPost('type') == 'edit') { $control->updateUserRole($data->getPost()); } } } $views->assign('title', '用户组管理'); $views->assign('roles', $list); $views->assign('app', $app); $views->display('admin/usergroups/index.html.twig'); }