function RouterRebuildConfirmForm::submitForm

Same name in other branches
  1. 4.x src/Form/RouterRebuildConfirmForm.php \Drupal\devel\Form\RouterRebuildConfirmForm::submitForm()
  2. 5.x src/Form/RouterRebuildConfirmForm.php \Drupal\devel\Form\RouterRebuildConfirmForm::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();
    drupal_set_message($this->t('The router has been rebuilt.'));
    $form_state->setRedirect('<front>');
}