示例#1
0
文件: Router.php 项目: phpf/routes
 /**
  * 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;
 }
示例#2
0
文件: Generator.php 项目: phpf/routes
 public function patch($name, $uri, $action = null)
 {
     $this->collection->add(new Route($name, 'PATCH', $uri, $action));
     return $this;
 }