class Route implements Serializable
A Route describes a route and its parameters.
__construct(string $path, array $defaults = array(), array $requirements = array(), array $options = array(), string $host = '', string|array $schemes = array(), string|array $methods = array(), string $condition = '') Constructor. | ||
serialize() {@inheritdoc} | ||
unserialize($serialized) {@inheritdoc} | ||
string | getPattern() Returns the pattern for the path. | |
Route | setPattern(string $pattern) Sets the pattern for the path. | |
string | getPath() Returns the pattern for the path. | |
Route | setPath(string $pattern) Sets the pattern for the path. | |
string | getHost() Returns the pattern for the host. | |
Route | setHost(string $pattern) Sets the pattern for the host. | |
array | getSchemes() Returns the lowercased schemes this route is restricted to. | |
Route | setSchemes(string|array $schemes) Sets the schemes (e.g. | |
bool | hasScheme(string $scheme) Checks if a scheme requirement has been set. | |
array | getMethods() Returns the uppercased HTTP methods this route is restricted to. | |
Route | setMethods(string|array $methods) Sets the HTTP methods (e.g. | |
array | getOptions() Returns the options. | |
Route | setOptions(array $options) Sets the options. | |
Route | addOptions(array $options) Adds options. | |
Route | setOption(string $name, mixed $value) Sets an option value. | |
mixed | getOption(string $name) Get an option value. | |
bool | hasOption(string $name) Checks if an option has been set. | |
array | getDefaults() Returns the defaults. | |
Route | setDefaults(array $defaults) Sets the defaults. | |
Route | addDefaults(array $defaults) Adds defaults. | |
mixed | getDefault(string $name) Gets a default value. | |
bool | hasDefault(string $name) Checks if a default value is set for the given variable. | |
Route | setDefault(string $name, mixed $default) Sets a default value. | |
array | getRequirements() Returns the requirements. | |
Route | setRequirements(array $requirements) Sets the requirements. | |
Route | addRequirements(array $requirements) Adds requirements. | |
string|null | getRequirement(string $key) Returns the requirement for the given key. | |
bool | hasRequirement(string $key) Checks if a requirement is set for the given key. | |
Route | setRequirement(string $key, string $regex) Sets a requirement for the given key. | |
string | getCondition() Returns the condition. | |
Route | setCondition(string $condition) Sets the condition. | |
CompiledRoute | compile() Compiles the route. |
Constructor.
Available options:
{@inheritdoc}
{@inheritdoc}
Returns the pattern for the path.
Sets the pattern for the path.
This method implements a fluent interface.
Returns the pattern for the path.
Sets the pattern for the path.
This method implements a fluent interface.
Returns the pattern for the host.
Sets the pattern for the host.
This method implements a fluent interface.
Returns the lowercased schemes this route is restricted to.
So an empty array means that any scheme is allowed.
Sets the schemes (e.g.
'https') this route is restricted to. So an empty array means that any scheme is allowed.
This method implements a fluent interface.
Checks if a scheme requirement has been set.
Returns the uppercased HTTP methods this route is restricted to.
So an empty array means that any method is allowed.
Sets the HTTP methods (e.g.
'POST') this route is restricted to. So an empty array means that any method is allowed.
This method implements a fluent interface.
Returns the options.
Sets the options.
This method implements a fluent interface.
Adds options.
This method implements a fluent interface.
Sets an option value.
This method implements a fluent interface.
Get an option value.
Checks if an option has been set.
Returns the defaults.
Sets the defaults.
This method implements a fluent interface.
Adds defaults.
This method implements a fluent interface.
Gets a default value.
Checks if a default value is set for the given variable.
Sets a default value.
Returns the requirements.
Sets the requirements.
This method implements a fluent interface.
Adds requirements.
This method implements a fluent interface.
Returns the requirement for the given key.
Checks if a requirement is set for the given key.
Sets a requirement for the given key.
Returns the condition.
Sets the condition.
This method implements a fluent interface.
Compiles the route.
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/2.8/Symfony/Component/Routing/Route.html