class Route
A Route describes a route and its parameters.
Methods
|
__construct(string $pattern, array $defaults = array(), array $requirements = array(), array $options = array())
Constructor. |
||
| __clone() | ||
| string |
getPattern()
Returns the pattern. |
|
| Route |
setPattern(string $pattern)
Sets the pattern. |
|
| array |
getOptions()
Returns the options. |
|
| Route |
setOptions(array $options)
Sets the options. |
|
| Route |
setOption(string $name, mixed $value)
Sets an option value. |
|
| mixed |
getOption(string $name)
Get an option value. |
|
| array |
getDefaults()
Returns the defaults. |
|
| Route |
setDefaults(array $defaults)
Sets the defaults. |
|
| mixed |
getDefault(string $name)
Gets a default value. |
|
| Boolean |
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. |
|
| string |
getRequirement(string $key)
Returns the requirement for the given key. |
|
| Route |
setRequirement(string $key, string $regex)
Sets a requirement for the given key. |
|
| CompiledRoute |
compile()
Compiles the route. |
Details
at line 45
public
__construct(string $pattern, array $defaults = array(), array $requirements = array(), array $options = array())
Constructor.
Available options:
* compiler_class: A class name able to compile this route instance (RouteCompiler by default)
at line 53
public
__clone()
at line 63
public string
getPattern()
Returns the pattern.
at line 77
public Route
setPattern(string $pattern)
Sets the pattern.
This method implements a fluent interface.
at line 94
public array
getOptions()
Returns the options.
at line 108
public Route
setOptions(array $options)
Sets the options.
This method implements a fluent interface.
at line 129
public Route
setOption(string $name, mixed $value)
Sets an option value.
This method implements a fluent interface.
at line 143
public mixed
getOption(string $name)
Get an option value.
at line 153
public array
getDefaults()
Returns the defaults.
at line 167
public Route
setDefaults(array $defaults)
Sets the defaults.
This method implements a fluent interface.
at line 184
public mixed
getDefault(string $name)
Gets a default value.
at line 196
public Boolean
hasDefault(string $name)
Checks if a default value is set for the given variable.
at line 211
public Route
setDefault(string $name, mixed $default)
Sets a default value.
at line 223
public array
getRequirements()
Returns the requirements.
at line 237
public Route
setRequirements(array $requirements)
Sets the requirements.
This method implements a fluent interface.
at line 254
public string
getRequirement(string $key)
Returns the requirement for the given key.
at line 269
public Route
setRequirement(string $key, string $regex)
Sets a requirement for the given key.
at line 281
public CompiledRoute
compile()
Compiles the route.