Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295778

Replace l() by a method on the link generator

$
0
0

Problem/Motivation

There are a couple of usecases for generating links/urls.

  • You want to generate an URL to a path controlled by drupal: (new URL($route_name))->toString()
  • You want to generate an external URL, just (new URL($external_url))->toString()
  • Generate a link with a given route: LinkGeneratorInterface->generate($text, $route_name)
  • Generate a ink to an external path, path without a route: l()

Proposed resolution

Let's reuse most of the logic of the link generator for the l method(). Introduces LinkGeneratorInterface->generateFromPath($path)

Remaining tasks

User interface changes

API changes


Viewing all articles
Browse latest Browse all 295778

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>