Created
October 19, 2017 17:54
-
-
Save suresh-kumara-gist/1b0910815e1f38954029ce1fb2bf905c to your computer and use it in GitHub Desktop.
create add conact form link in drupal 8
This file contains 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 characters
use Drupal\Core\Url; | |
use Drupal\Core\Link; | |
$url = Url::fromRoute('entity.contact_form.canonical', ['contact_form' => 'ventures_contact_form'], [ | |
'query' => ['venture_id' => 3], | |
'absolute' => TRUE, | |
]); | |
$project_link = Link::fromTextAndUrl(t('Conatact venture'), $url); | |
$project_link = $project_link->toRenderable(); | |
$project_link['#attributes'] = ['class' => ['use-ajax'], 'data-dialog-type' => ['modal']]; | |
$project_link['#prefix'] = '<div class="btn venture-contact-button" >'; | |
$project_link['#suffix'] = '</div>'; | |
print render($project_link); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment