rudloff/drupal-link-psr13

This package is abandoned and no longer maintained. No replacement package was suggested.

Convert Drupal URL objects to PSR-13 compliant link objects

0.1.0 2022-02-09 19:38 UTC

This package is auto-updated.

Last update: 2024-01-27 19:24:54 UTC


README

This library converts Drupal URL objects to PSR-13 compliant link objects.

It can be used to pass links generated by Drupal to a PSR-13 library like Symfony WebLink.

Usage

// Create a link object from a Drupal URL
$link = new \DrupalLinkPsr\Link(
    \Drupal\Core\Url::fromUri('https://example.com/')
);

// Get an array of attributes
$link->getAttributes();

// Get the URL
$link->getHref();