db = \Zend_Registry::get('db'); }else{ $this->db = $db; } $this->config = \Zend_Registry::get('config'); } public function checkReferenceParam(\Zend_EventManager_Event $e) { $data = $e->getParam('data'); if(!is_array($data)) { return "参数错误"; } if(empty($data["title"])) { return "请输入标题"; } if(empty($data['reference'])) { return "请输入前台引用方式,并且唯一"; } return true; } public function processReferenceData(\Zend_EventManager_Event $e) { $data = $e->getParam('data'); if(empty($data['attid'])) { $data['attid'] = 0; } return $data; } }