You are here

public function DisableLanguageSettings::submitForm in Disable language 8

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides ConfigFormBase::submitForm

File

src/Form/DisableLanguageSettings.php, line 128

Class

DisableLanguageSettings
Class DisableLanguageSettings.

Namespace

Drupal\disable_language\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $values = $form_state
    ->getValue('redirect_override_routes');
  $values = $this
    ->explodeToArray($values);
  $this
    ->config('disable_language.settings')
    ->set('redirect_override_routes', $values)
    ->save();
  $condition = $form_state
    ->get([
    'conditions',
    'request_path',
  ]);
  $condition
    ->submitConfigurationForm($form['exclude_request_path'], SubformState::createForSubform($form['exclude_request_path'], $form, $form_state));
  $condition_configuration = $condition
    ->getConfiguration();
  $this
    ->config('disable_language.settings')
    ->set('exclude_request_path', $condition_configuration)
    ->save();
}