You are here

public function YamapsForm::buildForm in Yandex.Maps 8

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

src/Form/YamapsForm.php, line 25

Class

YamapsForm
Provides forms for managing Node Order.

Namespace

Drupal\yamaps\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['yamaps_api_key'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('API key for Yandex.Maps API'),
    '#default_value' => $this
      ->config('yamaps.settings')
      ->get('yamaps_api_key'),
    '#description' => $this
      ->t('Since Yandex changed access to their API we have to send an API key. You can get API key %api_link. More info you can find %here', [
      '%api_link' => Link::fromTextAndUrl($this
        ->t('here'), Url::fromUri('https://developer.tech.yandex.ru'))
        ->toString(),
      '%here' => Link::fromTextAndUrl($this
        ->t('here'), Url::fromUri('https://yandex.ru/blog/mapsapi/novye-pravila-dostupa-k-api-kart'))
        ->toString(),
    ]),
  ];
  return parent::buildForm($form, $form_state);
}