/** * Finds a matching route. * * @return boolean True if a match was found, otherwise false. */ public function __invoke() { $strategy = $this->getStrategy(); foreach ($this->collection as $route) { if (!$route->isCompiled()) { $this->collection->getCompiler()->compile($route); } if ($strategy->matchRoute($route)) { $this->match = $route; return true; } } return false; }
public function patch($name, $uri, $action = null) { $this->collection->add(new Route($name, 'PATCH', $uri, $action)); return $this; }