You are here

protected function RouteSubscriber::setBundleAsTitle in Lightning Core 8.4

Same name and namespace in other branches
  1. 8.5 src/Routing/RouteSubscriber.php \Drupal\lightning_core\Routing\RouteSubscriber::setBundleAsTitle()
  2. 8 src/Routing/RouteSubscriber.php \Drupal\lightning_core\Routing\RouteSubscriber::setBundleAsTitle()
  3. 8.2 src/Routing/RouteSubscriber.php \Drupal\lightning_core\Routing\RouteSubscriber::setBundleAsTitle()
  4. 8.3 src/Routing/RouteSubscriber.php \Drupal\lightning_core\Routing\RouteSubscriber::setBundleAsTitle()

Sets FieldUiTitleController::bundle() as the title callback for a route.

Parameters

string $route_name: The route name.

\Symfony\Component\Routing\RouteCollection $collection: The complete route collection containing the route to alter.

1 call to RouteSubscriber::setBundleAsTitle()
RouteSubscriber::alterRoutes in src/Routing/RouteSubscriber.php
Alters existing routes for a specific collection.

File

src/Routing/RouteSubscriber.php, line 91

Class

RouteSubscriber
Dynamically alters various routes.

Namespace

Drupal\lightning_core\Routing

Code

protected function setBundleAsTitle($route_name, RouteCollection $collection) {
  $route = $collection
    ->get($route_name);
  if ($route) {
    $route
      ->setDefault('_title_callback', FieldUiTitleController::class . '::bundle');
  }
}