public function CspSettingsForm::submitClearPolicy in Content-Security-Policy 8
Submit handler for clear policy buttons.
Parameters
array $form: The form structure.
\Drupal\Core\Form\FormStateInterface $form_state: The form state.
File
- src/
Form/ CspSettingsForm.php, line 646
Class
- CspSettingsForm
- Form for editing Content Security Policy module settings.
Namespace
Drupal\csp\FormCode
public function submitClearPolicy(array &$form, FormStateInterface $form_state) {
$submitElement = $form_state
->getTriggeringElement();
$this
->config('csp.settings')
->clear($submitElement['#cspPolicyType'])
->save();
}