db = new Pdo(); $this->config = Config::get(); } //检查字段 public function checkParam(EventInterface $e){ $data = $e->getParam('data'); if(!is_array($data)) { return "参数错误"; } if(empty($data['url'])) { return "请填写要跳转的目标地址"; } if(!preg_match("/(http|ftp|https):\/\/(.*)/i",$data['url'])) { return "请填写完整的url,必须包含协议名称,例如 https://www.google.com.hk"; } return true; }//checkParam //处理字段 public function processData(EventInterface $e) { $data = $e->getParam('data'); return $data; } }