function UserLanguageTestForm::buildForm

Same name and namespace in other branches
  1. 10 core/modules/user/tests/modules/user_language_test/src/Form/UserLanguageTestForm.php \Drupal\user_language_test\Form\UserLanguageTestForm::buildForm()
  2. main core/modules/user/tests/modules/user_language_test/src/Form/UserLanguageTestForm.php \Drupal\user_language_test\Form\UserLanguageTestForm::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 FormInterface::buildForm

File

core/modules/user/tests/modules/user_language_test/src/Form/UserLanguageTestForm.php, line 26

Class

UserLanguageTestForm
Provides a User Language Test form.

Namespace

Drupal\user_language_test\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['#action'] = Url::fromRoute('user_language_test.post_response')->toString();
  $form['actions'] = [
    '#type' => 'actions',
    'submit' => [
      '#type' => 'submit',
      '#value' => $this->t('Send'),
    ],
  ];
  return $form;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.