/** * 执行路由操作 *+------------- * @param Void * @return Array */ public function execute() { if ($this->matchs) { foreach ($this->matchs as $key => $val) { if (preg_match('`^[a-z]+$`', $key)) { if (!preg_match('`^(directory|controller|action|)$`', $key)) { $this->request->setparam($key, $val); //设置request对象请求参数 unset($this->matchs[$key]); } } else { unset($this->matchs[$key]); } } if (isset($this->routes[$this->active][2])) { $this->matchs = array_merge($this->routes[$this->active][2], $this->matchs); } if (isset($this->matchs['controller'], $this->matchs['action'])) { return $this->matchs; } } throw new Ada_Exception('The requ'); //请求uri没有匹配路由表中任何一条规则 }