Dmitriy Gnatenko 2e430a556d Vendors updated | %!s(int64=3) %!d(string=hai) anos | |
---|---|---|
.. | ||
EventListener | %!s(int64=4) %!d(string=hai) anos | |
CHANGELOG.md | %!s(int64=4) %!d(string=hai) anos | |
GenericLinkProvider.php | %!s(int64=4) %!d(string=hai) anos | |
HttpHeaderSerializer.php | %!s(int64=3) %!d(string=hai) anos | |
LICENSE | %!s(int64=3) %!d(string=hai) anos | |
Link.php | %!s(int64=3) %!d(string=hai) anos | |
README.md | %!s(int64=3) %!d(string=hai) anos | |
composer.json | %!s(int64=3) %!d(string=hai) anos |
The WebLink component manages links between resources. It is particularly useful to advise clients to preload and prefetch documents through HTTP and HTTP/2 pushes.
This component implements the HTML5's Links, Preload and Resource Hints W3C's specifications. It can also be used with extensions defined in the HTML5 link type extensions wiki.
$ composer require symfony/web-link
use Symfony\Component\WebLink\GenericLinkProvider;
use Symfony\Component\WebLink\HttpHeaderSerializer;
use Symfony\Component\WebLink\Link;
$linkProvider = (new GenericLinkProvider())
->withLink(new Link('preload', '/bootstrap.min.css'));
header('Link: '.(new HttpHeaderSerializer())->serialize($linkProvider->getLinks()));
echo 'Hello';