public function GroupForm::cancel in Group 8
Same name and namespace in other branches
- 2.0.x src/Entity/Form/GroupForm.php \Drupal\group\Entity\Form\GroupForm::cancel()
Cancels the wizard for group creator membership.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
See also
\Drupal\group\Entity\Controller\GroupController::addForm()
File
- src/
Entity/ Form/ GroupForm.php, line 111
Class
- GroupForm
- Form controller for the group add and edit forms.
Namespace
Drupal\group\Entity\FormCode
public function cancel(array &$form, FormStateInterface $form_state) {
$store = $this->privateTempStoreFactory
->get($form_state
->get('group_wizard_id'));
$store_id = $form_state
->get('store_id');
$store
->delete("{$store_id}:entity");
$store
->delete("{$store_id}:step");
// Redirect to the front page if no destination was set in the URL.
$form_state
->setRedirect('<front>');
}