drupal 8 link render array

Solutions on MaxInterview for drupal 8 link render array by the best coders in the world

showing results for - "drupal 8 link render array"
Sixtine
18 Jan 2019
1$url = Url::fromRoute('entity.node.edit_form', array('node' => NID));
2$link = [
3  '#type' => 'link',
4  '#url' => $url,
5  '#title' => t('This link was rendered')
6];
Eliza
05 Feb 2020
1use Drupal\Core\Url;
2
3$rendable_link = [
4  '#type' => 'link',
5  '#title' => $this->t('Link title'),
6  '#url' => Url::fromRoute('YOUR_ROUTE'),
7];