Symfony\Component\Routing\Generator\UrlGenerator
UrlGenerator can generate a URL or a path for any route in the RouteCollection based on the passed parameters.
- Author: Fabien Potencier <fabien@symfony.com>
Synopsis
class UrlGenerator
implements
UrlGeneratorInterface,ConfigurableRequirementsInterface
{
- // members
- protected RouteCollection $routes;
- protected RequestContext $context;
- protected Boolean|null $strictRequirements;
- protected LoggerInterface|null $logger;
- protected array $decodedChars;
- // methods
- public void __construct()
- public void setContext()
- public void getContext()
- public void setStrictRequirements()
- public void isStrictRequirements()
- public void generate()
- protected void doGenerate()
- public static string getRelativePath()
Hierarchy
Implements
Constants
Name | Value |
---|---|
ABSOLUTE_URL | |
ABSOLUTE_PATH | |
RELATIVE_PATH | 'relative' |
NETWORK_PATH | 'network' |
Members
protected
- $context — Symfony\Component\Routing\RequestContext
-
$decodedChars
This array defines the characters (besides alphanumeric ones) that will not be percent-encoded in the path segment of the generated URL. - $logger — Symfony\Component\Routing\Generator\LoggerInterface|null
- $routes — Symfony\Component\Routing\RouteCollection
- $strictRequirements — Symfony\Component\Routing\Generator\Boolean|null
Methods
protected
public
- __construct() — Constructor.
- generate() — {@inheritDoc}
- getContext() — {@inheritdoc}
- getRelativePath() — Returns the target path as relative reference from the base path.
- isStrictRequirements() — {@inheritdoc}
- setContext() — {@inheritdoc}
- setStrictRequirements() — {@inheritdoc}