Symfony\Component\Routing\Route
A Route describes a route and its parameters.
- Author: Fabien Potencier <fabien@symfony.com>
Synopsis
class Route
implements
Serializable
{
- // members
- private string $path;
- private string $host;
- private array $schemes;
- private array $methods;
- private array $defaults;
- private array $requirements;
- private array $options;
- private null|RouteCompiler $compiled;
- // methods
- public void __construct()
- public void serialize()
- public void unserialize()
- public string getPattern()
- public Route setPattern()
- public string getPath()
- public Route setPath()
- public string getHost()
- public Route setHost()
- public array getSchemes()
- public Route setSchemes()
- public array getMethods()
- public Route setMethods()
- public array getOptions()
- public Route setOptions()
- public Route addOptions()
- public Route setOption()
- public mixed getOption()
- public Boolean hasOption()
- public array getDefaults()
- public Route setDefaults()
- public Route addDefaults()
- public mixed getDefault()
- public Boolean hasDefault()
- public Route setDefault()
- public array getRequirements()
- public Route setRequirements()
- public Route addRequirements()
- public string|null getRequirement()
- public Boolean hasRequirement()
- public Route setRequirement()
- public CompiledRoute compile()
- private void sanitizeRequirement()
Hierarchy
Implements
Members
private
- $compiled — Symfony\Component\Routing\null|RouteCompiler
- $defaults — array
- $host — string
- $methods — array
- $options — array
- $path — string
- $requirements — array
- $schemes — array
Methods
private
public
- __construct() — Constructor.
- addDefaults() — Adds defaults.
- addOptions() — Adds options.
- addRequirements() — Adds requirements.
- compile() — Compiles the route.
- getDefault() — Gets a default value.
- getDefaults() — Returns the defaults.
- getHost() — Returns the pattern for the host.
- getMethods() — Returns the uppercased HTTP methods this route is restricted to.
- getOption() — Get an option value.
- getOptions() — Returns the options.
- getPath() — Returns the pattern for the path.
- getPattern() — Returns the pattern for the path.
- getRequirement() — Returns the requirement for the given key.
- getRequirements() — Returns the requirements.
- getSchemes() — Returns the lowercased schemes this route is restricted to.
- hasDefault() — Checks if a default value is set for the given variable.
- hasOption() — Checks if an option has been set
- hasRequirement() — Checks if a requirement is set for the given key.
- serialize()
- setDefault() — Sets a default value.
- setDefaults() — Sets the defaults.
- setHost() — Sets the pattern for the host.
- setMethods() — Sets the HTTP methods (e.g. 'POST') this route is restricted to.
- setOption() — Sets an option value.
- setOptions() — Sets the options.
- setPath() — Sets the pattern for the path.
- setPattern() — Sets the pattern for the path.
- setRequirement() — Sets a requirement for the given key.
- setRequirements() — Sets the requirements.
- setSchemes() — Sets the schemes (e.g. 'https') this route is restricted to.
- unserialize()