public function JsonApiSettingsForm::submitForm in JSON:API 8.2
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/ 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);
}