You are here

public function EntityController::title in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Entity/Controller/EntityController.php \Drupal\Core\Entity\Controller\EntityController::title()

Provides a generic title callback for a single entity.

Parameters

\Drupal\Core\Routing\RouteMatchInterface $route_match: The route match.

\Drupal\Core\Entity\EntityInterface $_entity: (optional) An entity, passed in directly from the request attributes.

Return value

string The title for the entity view page.

File

core/lib/Drupal/Core/Entity/Controller/EntityController.php, line 71
Contains \Drupal\Core\Entity\Controller\EntityController.

Class

EntityController
Provides generic entity title callbacks for use in routing.

Namespace

Drupal\Core\Entity\Controller

Code

public function title(RouteMatchInterface $route_match, EntityInterface $_entity = NULL) {
  if ($entity = $this
    ->doGetEntity($route_match, $_entity)) {
    return $entity
      ->label();
  }
}