__construct() 공개 메소드

### Options - _ext - Defines the extensions used for this route. - pass - Copies the listed parameters into params['pass'].
public __construct ( string $template, array | string $defaults = [], array $options = [] )
$template string Template string with parameter placeholders
$defaults array | string Defaults for the route.
$options array Array of additional options for the Route
예제 #1
0
 /**
  * Constructor
  *
  * @param string $template Template string with parameter placeholders
  * @param array|string $defaults Defaults for the route.
  * @param array $options Array of additional options for the Route
  */
 public function __construct($template, $defaults = [], array $options = [])
 {
     parent::__construct($template, $defaults, $options);
     if (is_array($defaults) && isset($defaults['redirect'])) {
         $defaults = $defaults['redirect'];
     }
     $this->redirect = (array) $defaults;
 }
예제 #2
0
 /**
  * Constructor
  *
  * @param string $template Template string with parameter placeholders
  * @param array|string $defaults Defaults for the route.
  * @param array $options Array of additional options for the Route
  */
 public function __construct($template, $defaults = [], array $options = [])
 {
     parent::__construct($template, $defaults, $options);
     $this->redirect = (array) $defaults;
 }