function FormBase::getRouteMatch

Same name in other branches
  1. 9 core/lib/Drupal/Core/Form/FormBase.php \Drupal\Core\Form\FormBase::getRouteMatch()
  2. 8.9.x core/lib/Drupal/Core/Form/FormBase.php \Drupal\Core\Form\FormBase::getRouteMatch()
  3. 10 core/lib/Drupal/Core/Form/FormBase.php \Drupal\Core\Form\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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.