public function CreateRegistrationPageForm::submitForm in Multiple Registration 8
Same name and namespace in other branches
- 8.2 src/Form/CreateRegistrationPageForm.php \Drupal\multiple_registration\Form\CreateRegistrationPageForm::submitForm()
- 3.x src/Form/CreateRegistrationPageForm.php \Drupal\multiple_registration\Form\CreateRegistrationPageForm::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
- src/
Form/ CreateRegistrationPageForm.php, line 116
Class
- CreateRegistrationPageForm
- Class CreateRegistrationPageForm.
Namespace
Drupal\multiple_registration\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
parent::submitForm($form, $form_state);
$rid = $form_state
->getValue('rid');
$source = $form_state
->getValue('multiple_registration_url_' . $rid);
$alias = $form_state
->getValue('multiple_registration_path_' . $rid);
$isHidden = $form_state
->getValue('multiple_registration_hidden_' . $rid);
$this
->config('multiple_registration.create_registration_page_form_config')
->set('multiple_registration_path_' . $rid, $alias)
->set('multiple_registration_url_' . $rid, $source)
->set('multiple_registration_hidden_' . $rid, $isHidden)
->save();
$this->multipleRegistrationController
->addRegisterPageAlias($source, '/' . $alias);
$this->routeBuilder
->rebuild();
$this->cacheRender
->invalidateAll();
$form_state
->setRedirect('multiple_registration.multiple_registration_list_index');
}