public function HereMapsSettings::buildForm in Geolocation Field 8.2
Same name and namespace in other branches
- 8.3 modules/geolocation_here/src/Form/HereMapsSettings.php \Drupal\geolocation_here\Form\HereMapsSettings::buildForm()
Form constructor.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Return value
array The form structure.
Overrides ConfigFormBase::buildForm
File
- modules/geolocation_here/ src/ Form/ HereMapsSettings.php, line 18 
Class
- HereMapsSettings
- Implements the HERE Maps form controller.
Namespace
Drupal\geolocation_here\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this->configFactory
    ->get('here_maps.settings');
  $form['app_id'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('HERE Maps App ID'),
    '#default_value' => $config
      ->get('app_id'),
    '#description' => $this
      ->t('HERE Maps requires users to sign up at <a href="https://developer.here.com">developers.here.com</a>.'),
  ];
  $form['app_code'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('HERE Maps App Code'),
    '#default_value' => $config
      ->get('app_code'),
  ];
  return parent::buildForm($form, $form_state);
}