Drupal 8 links or where is my l() function ?

Submitted by christophe on Thu, 07/04/2016 - 07:24

The l() function is deprecated in Drupal 8, here is a starter.

Import the URL and Link classes :

use Drupal\Core\Url;
use Drupal\Core\Link;

You have several options, but basically, you can start with an url that will be used by a link.
One of the possible implementation will be used, with the Link::fromTextAndUrl method.