Skip to content

Instantly share code, notes, and snippets.

@oskarcalvo
Created October 26, 2016 08:45
Show Gist options
  • Save oskarcalvo/e6cc1619c9fcfef3b5ea38c84444c1e2 to your computer and use it in GitHub Desktop.
Save oskarcalvo/e6cc1619c9fcfef3b5ea38c84444c1e2 to your computer and use it in GitHub Desktop.
form
<?php
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$config = $this->config('googlelogin.settings');
$url = Url::fromUri('https://console.developers.google.com');
$text = t('Google project');
$link = Link::fromTextAndUrl($text, $url);
$html_link = render ($link->toRenderable());
$form['googlelogin_text'] = array(
'#type' => 'item',
'#markup' => '<h4 class="label">' . t('You can create a new project in google in this :link',[':link' => $html_link ]) . '</h4> ',
);
$form['googlelogin_id'] = array(
'#type' => 'textfield',
'#title' => $this->t('Google customer id'),
'#default_value' => $config->get('googlelogin.id'),
);
$form['googlelogin_secret'] = array(
'#type' => 'textfield',
'#title' => $this->t('Google customer secret'),
'#default_value' => $config->get('googlelogin.secret'),
);
return parent::buildForm($form, $form_state);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment