public function JsonApiSettingsForm::submitForm in Drupal 9
Same name and namespace in other branches
- 8 core/modules/jsonapi/src/Form/JsonApiSettingsForm.php \Drupal\jsonapi\Form\JsonApiSettingsForm::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
- core/
modules/ jsonapi/ src/ Form/ JsonApiSettingsForm.php, line 52
Class
- JsonApiSettingsForm
- Configure JSON:API settings for this site.
Namespace
Drupal\jsonapi\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$this
->config('jsonapi.settings')
->set('read_only', $form_state
->getValue('read_only') === 'r')
->save();
parent::submitForm($form, $form_state);
}