rudloff/drupal-link-psr13

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: 2022-11-09 21:22:29 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();