function Drupal::routeMatch

Same name in other branches
  1. 9 core/lib/Drupal.php \Drupal::routeMatch()
  2. 8.9.x core/lib/Drupal.php \Drupal::routeMatch()
  3. 10 core/lib/Drupal.php \Drupal::routeMatch()

Retrieves the currently active route match object.

Return value

\Drupal\Core\Routing\RouteMatchInterface The currently active route match object.

19 calls to Drupal::routeMatch()
CommentHooks::formFieldUiDisplayOverviewFormAlter in core/modules/comment/src/Hook/CommentHooks.php
Implements hook_form_FORM_ID_alter().
CommentHooks::formFieldUiFieldStorageAddFormAlter in core/modules/comment/src/Hook/CommentHooks.php
Implements hook_form_FORM_ID_alter() for field_ui_field_storage_add_form.
CommentHooks::formFieldUiFormDisplayOverviewFormAlter in core/modules/comment/src/Hook/CommentHooks.php
Implements hook_form_FORM_ID_alter().
CommonTestController::attachments in core/modules/system/tests/modules/common_test/src/Controller/CommonTestController.php
Returns a response with early rendering in common_test_page_attachments.
ContentTranslationHooks::pageAttachments in core/modules/content_translation/src/Hook/ContentTranslationHooks.php
Implements hook_page_attachments().

... See full list

File

core/lib/Drupal.php, line 299

Class

Drupal
Static Service Container wrapper.

Code

public static function routeMatch() {
    return static::getContainer()->get('current_route_match');
}

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