public function execute(\Coast\Request $req, \Coast\Response $res) { $route = $this->match($req->method(), $req->path()); if (!$route) { return; } $req->params(array_merge(['route' => $route], $route['params'])); if (isset($route['target'])) { return $route['target']($req, $res, $this->app); } else { if (isset($this->_target)) { return $this->_target->route($req, $res); } else { throw new Router\Exception("There's nothing to route '{$route['name']}' to"); } } }
public function execute(Request $req, Response $res) { if (!in_array($req->method(), $this->_methods)) { return; } $this->isValid($req->param($this->_name), true); $req->param($this->_name, null); }