Constructor.
Available options:
@api
string $path The path pattern to match:
array $defaults An array of default parameter values:
array $requirements An array of requirements for parameters (regexes):
array $options An array of options:
string $host The host pattern to match:
string|array $schemes A required URI scheme or an array of restricted schemes:
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()) {
$this
->setPath($path);
$this
->setDefaults($defaults);
$this
->setRequirements($requirements);
$this
->setOptions($options);
$this
->setHost($host);
// The conditions make sure that an initial empty $schemes/$methods does not override the corresponding requirement.
// They can be removed when the BC layer is removed.
if ($schemes) {
$this
->setSchemes($schemes);
}
if ($methods) {
$this
->setMethods($methods);
}
}