function NegotiationSessionForm::buildForm
Same name in other branches
- 9 core/modules/language/src/Form/NegotiationSessionForm.php \Drupal\language\Form\NegotiationSessionForm::buildForm()
- 8.9.x core/modules/language/src/Form/NegotiationSessionForm.php \Drupal\language\Form\NegotiationSessionForm::buildForm()
- 11.x core/modules/language/src/Form/NegotiationSessionForm.php \Drupal\language\Form\NegotiationSessionForm::buildForm()
Overrides ConfigFormBase::buildForm
File
-
core/
modules/ language/ src/ Form/ NegotiationSessionForm.php, line 32
Class
- NegotiationSessionForm
- Configure the session language negotiation method for this site.
Namespace
Drupal\language\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
$config = $this->config('language.negotiation');
$form['language_negotiation_session_param'] = [
'#title' => $this->t('Request/session parameter'),
'#type' => 'textfield',
'#default_value' => $config->get('session.parameter'),
'#description' => $this->t('Name of the request/session parameter used to determine the desired language.'),
];
$form_state->setRedirect('language.negotiation');
return parent::buildForm($form, $form_state);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.