RouteSubscriber.php in File Entity (fieldable files) 8.2
Namespace
Drupal\file_entity\RoutingFile
src/Routing/RouteSubscriber.phpView source
<?php
namespace Drupal\file_entity\Routing;
use Drupal\Core\Routing\RouteSubscriberBase;
use Symfony\Component\Routing\RouteCollection;
/**
* Listens to the dynamic route events.
*/
class RouteSubscriber extends RouteSubscriberBase {
/**
* {@inheritdoc}
*/
public function alterRoutes(RouteCollection $collection) {
// The usage view should be shown in the admin theme.
if ($route = $collection
->get('view.file_entity_files.usage')) {
$route
->setOption('_admin_route', TRUE);
}
}
}
Classes
Name | Description |
---|---|
RouteSubscriber | Listens to the dynamic route events. |