You are here

public function RouterRebuildConfirmForm::submitForm in Devel 8.2

Same name and namespace in other branches
  1. 8.3 src/Form/RouterRebuildConfirmForm.php \Drupal\devel\Form\RouterRebuildConfirmForm::submitForm()
  2. 8 src/Form/RouterRebuildConfirmForm.php \Drupal\devel\Form\RouterRebuildConfirmForm::submitForm()
  3. 4.x src/Form/RouterRebuildConfirmForm.php \Drupal\devel\Form\RouterRebuildConfirmForm::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 FormInterface::submitForm

File

src/Form/RouterRebuildConfirmForm.php, line 80

Class

RouterRebuildConfirmForm
Provides confirmation form for rebuilding the routes.

Namespace

Drupal\devel\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this->routeBuilder
    ->rebuild();
  $this
    ->messenger()
    ->addMessage($this
    ->t('The router has been rebuilt.'));
  $form_state
    ->setRedirect('<front>');
}