Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. AdminRouteSubscriber.php

function AdminRouteSubscriber::isHtmlRoute

Determines whether the given route is an HTML route.

Parameters

\Symfony\Component\Routing\Route $route: The route to analyze.

Return value

bool TRUE if HTML is a valid format for this route.

1 call to AdminRouteSubscriber::isHtmlRoute()
AdminRouteSubscriber::alterRoutes in core/modules/system/src/EventSubscriber/AdminRouteSubscriber.php
Alters existing routes for a specific collection.

File

core/modules/system/src/EventSubscriber/AdminRouteSubscriber.php, line 50

Class

AdminRouteSubscriber
Adds the _admin_route option to each admin HTML route.

Namespace

Drupal\system\EventSubscriber

Code

protected static function isHtmlRoute(Route $route) {
    // If a route has no explicit format, then HTML is valid.
    $format = $route->hasRequirement('_format') ? explode('|', $route->getRequirement('_format')) : [
        'html',
    ];
    return in_array('html', $format, TRUE);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal