You are here

public function ParagraphBlocksSettingsForm::submitForm in Paragraph blocks 8.2

Same name and namespace in other branches
  1. 3.x src/Form/ParagraphBlocksSettingsForm.php \Drupal\paragraph_blocks\Form\ParagraphBlocksSettingsForm::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/ParagraphBlocksSettingsForm.php, line 45

Class

ParagraphBlocksSettingsForm
Form for Paragraph Blocks settings.

Namespace

Drupal\paragraph_blocks\Form

Code

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