symfony/web-link

Manages links between resources

Maintainers

Package info

github.com/symfony/web-link

Homepage

pkg:composer/symfony/web-link

Transparency log

Statistics

Installs: 111 376 908

Dependents: 276

Suggesters: 6

Stars: 1 416

v8.1.0 2026-05-29 05:06 UTC

This package is auto-updated.

Last update: 2026-08-19 07:58:46 UTC


README

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.

It also implements Web Linking (RFC 8288), the two link set document formats defined by Linkset (RFC 9264) and the Link-Template HTTP header field (RFC 9652).

Getting Started

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';

Sponsor

This package is looking for a backer.

Help Symfony by sponsoring its development!

Resources