/** * 权限列表 */ public function listAction() { $this->view->layout['description'] = array('<ul> <li>权限名称必须为 2~20 英文字母+数字组成的字符</li> <li>权限说明长度为 2~80 个字符</li> </ul>'); $this->view->privileges = $this->privilege->getAll(); if ($this->_request->isPost()) { echo 'dd'; } }
/** * 添加规则 */ public function addAction() { if ($this->_request->isPost()) { try { $this->rule->add($this->_request->getPost()); $cache = Zend_Registry::get('cache'); $cache->remove('acl_resource'); // 删除缓存 $this->_redirect($this->view->url(array('action' => 'list'))); } catch (Exception $e) { $this->view->feedback(array('title' => '发生错误', 'message' => '操作失败:' . $e->getMessage())); } } $this->view->layout = array('title' => '管理后台 - 添加规则'); $this->view->privileges = $this->privilege->getAll(); }