예제 #1
0
파일: Router.php 프로젝트: molovo/traffic
 /**
  * Allow for static access to HTTP Methods.
  *
  * @param string $method The method name
  * @param array  $args   The function arguments
  *
  * @return mixed The route is compiled
  */
 public static function __callStatic($method, $args)
 {
     $method = strtolower($method);
     list($route, $closure) = $args;
     if (!in_array($method, static::$allowed)) {
         throw new InvalidMethodException($method . ' is not a valid method name.');
     }
     if (!static::$router) {
         static::$router = new static();
     }
     return static::$router->compile($method, $route, $closure);
 }