function RegionalForm::submitForm

Same name in other branches
  1. 9 core/modules/system/src/Form/RegionalForm.php \Drupal\system\Form\RegionalForm::submitForm()

Overrides ConfigFormBase::submitForm

File

core/modules/system/src/Form/RegionalForm.php, line 113

Class

RegionalForm
Configure regional settings for this site.

Namespace

Drupal\system\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
    $this->config('system.date')
        ->set('country.default', $form_state->getValue('site_default_country'))
        ->set('first_day', $form_state->getValue('date_first_day'))
        ->set('timezone.default', $form_state->getValue('date_default_timezone'))
        ->save();
    parent::submitForm($form, $form_state);
}

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