You are here

public function SettingsForm::submitForm in Menu Breadcrumb 8

Same name and namespace in other branches
  1. 2.0.x src/Form/SettingsForm.php \Drupal\menu_breadcrumb\Form\SettingsForm::submitForm()

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/SettingsForm.php, line 233

Class

SettingsForm

Namespace

Drupal\menu_breadcrumb\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this
    ->config('menu_breadcrumb.settings')
    ->set('determine_menu', (bool) $form_state
    ->getValue('determine_menu'))
    ->set('disable_admin_page', (bool) $form_state
    ->getValue('disable_admin_page'))
    ->set('append_current_page', (bool) $form_state
    ->getValue('append_current_page'))
    ->set('current_page_as_link', (bool) $form_state
    ->getValue('current_page_as_link'))
    ->set('stop_on_first_match', (bool) $form_state
    ->getValue('stop_on_first_match'))
    ->set('append_member_page', (bool) $form_state
    ->getValue('append_member_page'))
    ->set('member_page_as_link', (bool) $form_state
    ->getValue('member_page_as_link'))
    ->set('front_title', $form_state
    ->getValue('front_title'))
    ->set('remove_home', (bool) $form_state
    ->getValue('remove_home'))
    ->set('add_home', (bool) $form_state
    ->getValue('add_home'))
    ->set('menu_breadcrumb_menus', $form_state
    ->getValue('menu_breadcrumb_menus'))
    ->set('exclude_empty_url', $form_state
    ->getValue('exclude_empty_url'))
    ->set('exclude_disabled_menu_items', $form_state
    ->getValue('exclude_disabled_menu_items'))
    ->set('derived_active_trail', $form_state
    ->getValue('derived_active_trail'))
    ->save();
  parent::submitForm($form, $form_state);
}