Example #1
0
 /**
  * Create a new Route object.
  *
  * @param string $method
  * @param string $path
  *
  * @param mixed  $handler
  */
 public function __construct($method, $path, $handler)
 {
     // Set Route name
     $this->name = $this->extractFromHandler('as', $handler);
     // Init Parent
     parent::__construct($path, ['action' => $this->extractFromHandler('uses', $handler, null, true)], $this->extractFromHandler('requirements', $handler, []), $this->extractFromHandler('options', $handler, []), $this->extractFromHandler('domain', $handler, ''), $this->extractFromHandler('schemes', $handler, []), [$method]);
 }
Example #2
0
 public function __construct($path, array $defaults = array(), array $requirements = array(), array $options = array(), $host = '', $schemes = array(), $methods = array(), $condition = '')
 {
     parent::__construct($path, $defaults, $requirements, $options, $host, $schemes, $methods, $condition);
     $this->accessPublic();
     $this->secureByLoginSecurity();
     $this->setDefault(RouteAttribute::LOCALE, null);
 }
Example #3
0
 public function __construct($pattern, array $defaults = array(), array $requirements = array(), array $options = array())
 {
     parent::__construct($pattern, $defaults, $requirements, $options);
     // Set default format to HTML if none is explicitly set
     if (!isset($defaults['_format'])) {
         $this->setFormat($this->_defaultFormat);
     }
 }
Example #4
0
 public function __construct($path = '/', array $defaults = array(), array $requirements = array(), array $options = array(), $host = '', $schemes = array(), $methods = array())
 {
     parent::__construct($path, $defaults, $requirements, $options, $host, $schemes, $methods);
 }
Example #5
0
 /**
  * Constructor.
  *
  * Available options:
  *
  *  * compiler_class: A class name able to compile this route instance (RouteCompiler by default)
  *
  * @param string       $path         The path pattern to match
  * @param array        $defaults     An array of default parameter values
  * @param array        $requirements An array of requirements for parameters (regexes)
  * @param array        $options      An array of options
  * @param string       $host         The host pattern to match
  * @param string|array $schemes      A required URI scheme or an array of restricted schemes
  * @param string|array $methods      A required HTTP method or an array of restricted methods
  */
 public function __construct($path = '/', array $defaults = array(), array $requirements = array(), array $options = array(), $host = '', $schemes = array(), $methods = array())
 {
     // overridden constructor to make $path optional
     parent::__construct($path, $defaults, $requirements, $options, $host, $schemes, $methods);
 }
Example #6
0
 public function __construct($pattern = '', array $defaults = array(), array $requirements = array(), array $options = array())
 {
     parent::__construct($pattern, $defaults, $requirements, $options);
 }
Example #7
0
 /**
  * Constructor.
  *
  * Available options:
  *
  *  * compiler_class: A class name able to compile this route instance (RouteCompiler by default)
  *
  * @param string       $name         Name of the route
  * @param string       $path         The path pattern to match
  * @param array        $defaults     An array of default parameter values
  * @param array        $requirements An array of requirements for parameters (regexes)
  * @param array        $options      An array of options
  * @param string       $host         The host pattern to match
  * @param string|array $schemes      A required URI scheme or an array of restricted schemes
  * @param string|array $methods      A required HTTP method or an array of restricted methods
  *
  * @api
  */
 public function __construct($name, $path, array $defaults = array(), array $requirements = array(), array $options = array(), $host = '', $schemes = array(), $methods = array())
 {
     $this->setName($name);
     parent::__construct($path, $defaults, $requirements, $options, $host, $schemes, $methods);
     $this->updatedAt = new \DateTime();
 }
 /**
  * @param string          $method
  * @param array           $path
  * @param string|callable $action
  */
 public function __construct($method, $path, $action)
 {
     parent::__construct($path, ['action' => $action], [], [], null, [], $method, null);
 }
Example #9
0
 /**
  * Constructor.
  */
 public function __construct()
 {
     parent::__construct($this->routePattern);
     $this->setDefaults(array());
 }
 public function __construct()
 {
     parent::__construct('/');
     $this->children = array();
 }
Example #11
0
 /**
  * Constructor.
  *
  * Available requirements:
  *  - HTTP_<<headername>> : HTTP header value required
  *
  * @param string $pattern      The pattern to match
  * @param array  $defaults     An array of default parameter values
  * @param array  $requirements An array of requirements for parameters (regexes)
  * @param array  $options      An array of options
  */
 public function __construct($pattern, array $defaults = array(), array $requirements = array(), array $options = array())
 {
     parent::__construct($pattern, $defaults, $requirements, $options);
     $this->_addHeaderRequirements();
 }