8.5.x FormBase.php FormBase::getRouteMatch()
8.0.x FormBase.php FormBase::getRouteMatch()
8.1.x FormBase.php FormBase::getRouteMatch()
8.2.x FormBase.php FormBase::getRouteMatch()
8.3.x FormBase.php FormBase::getRouteMatch()
8.4.x FormBase.php FormBase::getRouteMatch()
8.6.x FormBase.php FormBase::getRouteMatch()

Gets the route match.

Return value

\Drupal\Core\Routing\RouteMatchInterface

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;
}