You are here

public function MenuTrailByPathSettingsForm::submitForm in Menu Trail By Path 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/MenuTrailByPathSettingsForm.php, line 73

Class

MenuTrailByPathSettingsForm
Configures menu trail by path settings for this site.

Namespace

Drupal\menu_trail_by_path\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $config = $this
    ->config('menu_trail_by_path.settings');
  $config
    ->set('max_path_parts', (int) $form_state
    ->getValue('max_path_parts'));
  $config
    ->set('trail_source', $form_state
    ->getValue('trail_source'));
  $config
    ->save();
}