class WebLinkExtension extends AbstractExtension
Twig extension for the Symfony WebLink component.
__construct(RequestStack $requestStack) | ||
getFunctions() {@inheritdoc} | ||
string | link(string $uri, string $rel, array $attributes = array()) Adds a "Link" HTTP header. | |
string | preload(string $uri, array $attributes = array()) Preloads a resource. | |
string | dnsPrefetch(string $uri, array $attributes = array()) Resolves a resource origin as early as possible. | |
string | preconnect(string $uri, array $attributes = array()) Initiates a early connection to a resource (DNS resolution, TCP handshake, TLS negotiation). | |
string | prefetch(string $uri, array $attributes = array()) Indicates to the client that it should prefetch this resource. | |
string | prerender(string $uri, array $attributes = array()) Indicates to the client that it should prerender this resource . |
RequestStack | $requestStack |
{@inheritdoc}
Adds a "Link" HTTP header.
string | $uri | The relation URI |
string | $rel | The relation type (e.g. "preload", "prefetch", "prerender" or "dns-prefetch") |
array | $attributes | The attributes of this link (e.g. "array('as' => true)", "array('pr' => 0.5)") |
string | The relation URI |
Preloads a resource.
string | $uri | A public path |
array | $attributes | The attributes of this link (e.g. "array('as' => true)", "array('crossorigin' => 'use-credentials')") |
string | The path of the asset |
Resolves a resource origin as early as possible.
string | $uri | A public path |
array | $attributes | The attributes of this link (e.g. "array('as' => true)", "array('pr' => 0.5)") |
string | The path of the asset |
Initiates a early connection to a resource (DNS resolution, TCP handshake, TLS negotiation).
string | $uri | A public path |
array | $attributes | The attributes of this link (e.g. "array('as' => true)", "array('pr' => 0.5)") |
string | The path of the asset |
Indicates to the client that it should prefetch this resource.
string | $uri | A public path |
array | $attributes | The attributes of this link (e.g. "array('as' => true)", "array('pr' => 0.5)") |
string | The path of the asset |
Indicates to the client that it should prerender this resource .
string | $uri | A public path |
array | $attributes | The attributes of this link (e.g. "array('as' => true)", "array('pr' => 0.5)") |
string | The path of the asset |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Bridge/Twig/Extension/WebLinkExtension.html