You are here

public function AdminSettingsForm::submitForm in Commerce Add To Cart Link 8

Same name and namespace in other branches
  1. 2.x src/Form/AdminSettingsForm.php \Drupal\commerce_add_to_cart_link\Form\AdminSettingsForm::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/AdminSettingsForm.php, line 105

Class

AdminSettingsForm
Provides the admin form for editing module settings.

Namespace

Drupal\commerce_add_to_cart_link\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $roles = array_values(array_filter($form_state
    ->getValue([
    'csrf_token',
    'roles',
  ])));
  $this
    ->config('commerce_add_to_cart_link.settings')
    ->set('csrf_token.roles', $roles)
    ->save();
  parent::submitForm($form, $form_state);
}