function LanguageConfigurationElementTest::buildForm

Same name in other branches
  1. 8.9.x core/modules/language/tests/language_elements_test/src/Form/LanguageConfigurationElementTest.php \Drupal\language_elements_test\Form\LanguageConfigurationElementTest::buildForm()
  2. 10 core/modules/language/tests/language_elements_test/src/Form/LanguageConfigurationElementTest.php \Drupal\language_elements_test\Form\LanguageConfigurationElementTest::buildForm()
  3. 11.x core/modules/language/tests/language_elements_test/src/Form/LanguageConfigurationElementTest.php \Drupal\language_elements_test\Form\LanguageConfigurationElementTest::buildForm()

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;
}

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