Advertisement
Guest User

Untitled

a guest
Nov 25th, 2015
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. <?php
  2.  
  3. $url = Url::fromRoute('node.add', array('node_type' => $content_type));
  4. $url->setOption('query', \Drupal::destination()->getAsArray(),);
  5.  
  6. $link = [
  7. '#type' => 'link',
  8. '#title' => t('Add !content_type content', array('!content_type' => $content_type)),
  9. '#url' => $url,
  10. '#attributes' => [
  11. 'class' => ['button', 'button-action', 'button--primary', 'button--small'],
  12. ]
  13. ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement