Example #1
0
 /**
  * @param   string          $pattern    The route pattern
  * @param   mixed           $action     The route action
  * @param   array|string    $methods    The route method(s)
  *
  * @retun   void
  */
 private static function addRoute($pattern, $action, $methods)
 {
     // Create new route entity
     $route = new Route($pattern, $action, $methods);
     // If a guard is present, add it to the route object
     if (!is_null(self::$guard) && !is_null(self::$redirect)) {
         $route->setGuard(self::$guard, self::$redirect);
     }
     // Add route entity to the internal route collection
     self::$router->addRoute($route);
 }