You are here

public function LanguageConfigurationElementTest::buildForm in Zircon Profile 8.0

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 27
Contains \Drupal\language_elements_test\Form\LanguageConfigurationElementTest.

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'] = array(
    '#title' => t('Language select'),
    '#type' => 'language_select',
    '#default_value' => language_get_default_langcode('entity_test', 'some_bundle'),
  );
  return $form;
}