You are here

protected function FormBase::getRouteMatch in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Form/FormBase.php \Drupal\Core\Form\FormBase::getRouteMatch()
  2. 9 core/lib/Drupal/Core/Form/FormBase.php \Drupal\Core\Form\FormBase::getRouteMatch()

Gets the route match.

Return value

\Drupal\Core\Routing\RouteMatchInterface

2 calls to FormBase::getRouteMatch()
DeleteMultipleForm::getFormId in core/lib/Drupal/Core/Entity/Form/DeleteMultipleForm.php
Returns a unique string identifying the form.
ViewsExposedForm::buildForm in core/modules/views/src/Form/ViewsExposedForm.php
Form constructor.

File

core/lib/Drupal/Core/Form/FormBase.php, line 165

Class

FormBase
Provides a base class for forms.

Namespace

Drupal\Core\Form

Code

protected function getRouteMatch() {
  if (!$this->routeMatch) {
    $this->routeMatch = \Drupal::routeMatch();
  }
  return $this->routeMatch;
}