public function ParagraphsSettingsForm::submitForm in Paragraphs 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/ ParagraphsSettingsForm.php, line 45
Class
- ParagraphsSettingsForm
- Form for Paragraphs settings.
Namespace
Drupal\paragraphs\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$config = $this
->config('paragraphs.settings');
$config
->set('show_unpublished', $form_state
->getValue('show_unpublished'));
$config
->save();
parent::submitForm($form, $form_state);
}