public EntityController::title(RouteMatchInterface $route_match, EntityInterface $_entity = NULL)
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|null The title for the entity view page, if an entity was found.
File
- core/lib/Drupal/Core/Entity/Controller/EntityController.php, line 226
Class
- EntityController
- Provides the add-page and title callbacks for entities.
Namespace
Drupal\Core\Entity\Controller
Code
1 2 3 4 5 | public function title(RouteMatchInterface $route_match , EntityInterface $_entity = NULL) { if ( $entity = $this ->doGetEntity( $route_match , $_entity )) { return $entity ->label(); } } |
Please login to continue.