/** * 用户角色 */ private function _rolesIndex() { $dataList = $this->_modelRoles->findAll(); foreach ($dataList as &$value) { $value['date_created'] = date('Y-m-d H:i', $value['date_created']); $value['date_updated'] = date('Y-m-d H:i', $value['date_updated']); $value['url_edit'] = Tools::url(CONTROL, ACTION, array('Id' => $value['Id'], 'doaction' => 'edit')); $value['url_del'] = Tools::url(CONTROL, ACTION, array('Id' => $value['Id'], 'doaction' => 'del')); $value['url_edit_perm'] = Tools::url('Prem', 'EditPrem', array('role_value' => $value['role_value'])); } $this->_view->assign('dataList', $dataList); $this->_view->set_tpl(array('body' => 'User/RolesIndex.html')); $this->_utilMsg->createNavBar(); $this->_view->display(); }
/** * 获取所有的角色 */ public function getAllRoles() { $this->_modelRoles = $this->_getGlobalData('Model_Roles', 'object'); $allRoles = $this->_modelRoles->findAll(); return $this->getTtwoArrConvertOneArr($allRoles, 'role_value', 'role_name'); }