public function XFrameOptionsConfigurationSettingsForm::submitForm in X-Frame-Options Configuration 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/ XFrameOptionsConfigurationSettingsForm.php, line 88
Class
- XFrameOptionsConfigurationSettingsForm
- Configure example settings for this site.
Namespace
Drupal\x_frame_options_configuration\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
// Retrieve the configuration.
$this->configFactory
->getEditable('x_frame_options_configuration.settings')
->set('x_frame_options_configuration.directive', Html::escape($form_state
->getValue('directive')))
->set('x_frame_options_configuration.allow-from-uri', UrlHelper::stripDangerousProtocols(Html::escape($form_state
->getValue('allow-from-uri'))))
->save();
parent::submitForm($form, $form_state);
}