Revisions
-
webflo revised this gist
Nov 25, 2015 . 1 changed file with 13 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,14 @@ <?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' => [ 'class' => ['button', 'button-action', 'button--primary', 'button--small'], ] ]; -
SteffenR created this gist
Nov 25, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ <?php $link_url = Url::fromRoute('node.add', array('node_type' => $content_type)); $link_url->setOptions(array( 'attributes' => array('class' => 'button button-action button--primary button--small'), 'query' => \Drupal::destination()->getAsArray(), )); $link_text = t('Add !content_type content', array('!content_type' => ucfirst($content_type))); // Build link $link = \Drupal::l($link_text, $link_url); ?>