Same filename and directory in other branches
- 8.9.x core/lib/Drupal/Core/Routing/AdminContext.php
- 9 core/lib/Drupal/Core/Routing/AdminContext.php
Namespace
Drupal\Core\Routing
File
core/lib/Drupal/Core/Routing/AdminContext.php
View source
<?php
namespace Drupal\Core\Routing;
use Symfony\Component\Routing\Route;
class AdminContext {
protected $routeMatch;
public function __construct(RouteMatchInterface $route_match) {
$this->routeMatch = $route_match;
}
public function isAdminRoute(Route $route = NULL) {
if (!$route) {
$route = $this->routeMatch
->getRouteObject();
if (!$route) {
return FALSE;
}
}
return (bool) $route
->getOption('_admin_route');
}
}
Classes
Name |
Description |
AdminContext |
Provides a helper class to determine whether the route is an admin one. |