public function PostalCodeSettingsForm::submitForm in Postal Code 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/ PostalCodeSettingsForm.php, line 113
Class
- PostalCodeSettingsForm
- Postal code admin settings form.
Namespace
Drupal\postal_code\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
// Write settings into config file.
$this->postalCodeSettings
->set('valid_countries', $form_state
->getValue('postal_code_valid_countries'))
->set('validate', $form_state
->getValue('postal_code_validate'))
->save();
parent::submitForm($form, $form_state);
}