Exemplo n.º 1
0
 public function __construct($method, $uri, $action)
 {
     $this->uriStr = $uri;
     $this->methodStr = $method;
     $this->actionStr = $action;
     parent::__construct($this->parseMethodStr($method), $this->parseUriStr($uri), $this->parseActionStr($action));
 }
Exemplo n.º 2
0
 /**
  * Create a new Route instance.
  *
  * @param  array          $methods
  * @param  string         $uri
  * @param  \Closure|array $action
  * @param                 $locale
  */
 public function __construct($methods, $uri, $action, $locale)
 {
     $this->locale = $locale;
     $this->baseUri = preg_replace('/\\b' . $locale . '\\b/', '%LOCALE%', $uri);
     $uri = static::translateUri($uri, $locale);
     if (array_key_exists('as', $action)) {
         $action['as'] .= '.' . $locale;
     }
     parent::__construct($methods, $uri, $action);
 }
Exemplo n.º 3
0
 /**
  * Build a Route instance.
  *
  * @param array|string $methods
  * @param string       $uri
  * @param mixed        $action
  */
 public function __construct($methods, $uri, $action)
 {
     parent::__construct($methods, $uri, $action);
     $this->parameters = [];
     /*
      * Parse the WordPress condition together with the parameters
      */
     $this->condition = $this->parseCondition($uri);
     $this->conditionalParameters = $this->parseConditionalParameters($action);
     /*
      * Create a WordPress rewrite rule if the route is a non-WordPress route
      */
     $this->createRewriteRule();
 }
Exemplo n.º 4
0
 /**
  * AlexaRoute constructor.
  * @param array|string   $methods
  * @param string         $uri
  * @param string         $intent
  * @param \Closure|array $action
  */
 public function __construct($methods, $uri, $intent, $action)
 {
     parent::__construct($methods, $uri, $action);
     $this->routeIntent = $intent;
 }
Exemplo n.º 5
0
 /**
  * Override
  */
 public function __construct($methods, $uri, $action)
 {
     parent::__construct($methods, $uri, $action);
     $this->compileRoute();
 }