How do I create a link?
\Drupal::l is deprecated.
Maybe this case will be useful for somebody

  use Drupal\Core\Url;
  use Drupal\Core\Link;
  $url = Url::fromRoute('entity.node.edit_form', array('node' =&gt; NID));
  $project_link = Link::fromTextAndUrl(t('Open Project'), $url);
  $project_link = $project_link-&gt;toRenderable();
  // If you need some attributes.
  $project_link['#attributes'] = array('class' =&gt; array('button', 'button-action', 'button--primary', 'button--small'));
  print render($project_link);