NegotiationSelectedForm::buildForm

public NegotiationSelectedForm::buildForm(array $form, FormStateInterface $form_state)

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

core/modules/language/src/Form/NegotiationSelectedForm.php, line 31

Class

NegotiationSelectedForm
Configure the selected language negotiation method for this site.

Namespace

Drupal\language\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this->config('language.negotiation');
  $form['selected_langcode'] = array(
    '#type' => 'language_select',
    '#title' => $this->t('Language'),
    '#languages' => LanguageInterface::STATE_CONFIGURABLE | LanguageInterface::STATE_SITE_DEFAULT,
    '#default_value' => $config->get('selected_langcode'),
  );

  return parent::buildForm($form, $form_state);
}
doc_Drupal
2016-10-29 09:30:03
Comments
Leave a Comment

Please login to continue.