class HttpFoundationExtension extends AbstractExtension
Twig extension for the Symfony HttpFoundation component.
__construct(RequestStack $requestStack, RequestContext $requestContext = null) | ||
getFunctions() {@inheritdoc} | ||
string | generateAbsoluteUrl(string $path) Returns the absolute URL for the given absolute or relative path. | |
string | generateRelativePath(string $path) Returns a relative path based on the current Request. | |
string | getName() Returns the name of the extension. |
RequestStack | $requestStack | |
RequestContext | $requestContext |
{@inheritdoc}
Returns the absolute URL for the given absolute or relative path.
This method returns the path unchanged if no request is available.
string | $path | The path |
string | The absolute URL |
Request::getUriForPath |
Returns a relative path based on the current Request.
This method returns the path unchanged if no request is available.
string | $path | The path |
string | The relative path |
Request::getRelativeUriForPath |
Returns the name of the extension.
string | The extension name |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Bridge/Twig/Extension/HttpFoundationExtension.html