rudloff / drupal-link-psr13
此包已被放弃,不再维护。未建议替代包。
将 Drupal URL 对象转换为 PSR-13 兼容的链接对象
0.1.0
2022-02-09 19:38 UTC
Requires
- php: >=8.0
- drupal/core: ^9
- psr/link: ^2.0
This package is auto-updated.
Last update: 2024-01-27 19:24:54 UTC
README
此库将 Drupal URL 对象转换为 PSR-13 兼容的链接对象。
它可以用于将 Drupal 生成的链接传递到 PSR-13 库,如 Symfony WebLink。
用法
// 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();