Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?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'],
- ]
- ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement