You are here

public function LanguageConfigurationElementTest::buildForm in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/language/tests/language_elements_test/src/Form/LanguageConfigurationElementTest.php \Drupal\language_elements_test\Form\LanguageConfigurationElementTest::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/language/tests/language_elements_test/src/Form/LanguageConfigurationElementTest.php, line 25

Class

LanguageConfigurationElementTest
A form containing a language select element.

Namespace

Drupal\language_elements_test\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['langcode'] = [
    '#title' => t('Language select'),
    '#type' => 'language_select',
    '#default_value' => language_get_default_langcode('entity_test', 'some_bundle'),
  ];
  return $form;
}