Skip to content

Instantly share code, notes, and snippets.

@webflo
webflo / nodecamp.eu-talks-2011.md
Created June 15, 2011 17:02 — forked from a2800276/nodecamp.eu-talks-2011.md
A collection of talks and presentations held at nodecamp.eu 2011
@webflo
webflo / url.php
Created November 25, 2015 15:08 — forked from steffenr/url.php
Create link with attributes in Drupal 8
<?php
$url = Url::fromRoute('node.add', array('node_type' => $content_type));
$url->setOption('query', \Drupal::destination()->getAsArray(),);
$link = [
'#type' => 'link',
'#title' => t('Add !content_type content', array('!content_type' => $content_type)),
'#url' => $url,
'#attributes' => [