Drupal 8  8.0.2
EntityViewController Class Reference
Inheritance diagram for EntityViewController:

Public Member Functions

 __construct (EntityManagerInterface $entity_manager, RendererInterface $renderer)
 
 buildTitle (array $page)
 
 view (EntityInterface $_entity, $view_mode= 'full')
 

Static Public Member Functions

static create (ContainerInterface $container)
 

Protected Attributes

 $entityManager
 
 $renderer
 

Detailed Description

Defines a generic controller to render a single entity.

Constructor & Destructor Documentation

__construct ( EntityManagerInterface  $entity_manager,
RendererInterface  $renderer 
)

Creates an EntityViewController object.

Parameters
\Drupal\Core\Entity\EntityManagerInterface$entity_managerThe entity manager.
\Drupal\Core\Render\RendererInterface$rendererThe renderer service.

References Drupal\entityManager().

Here is the call graph for this function:

Member Function Documentation

buildTitle ( array  $page)

Pre-render callback to build the page title.

Parameters
array$pageA page render array.
Returns
array The changed page render array.
static create ( ContainerInterface  $container)
static

{Instantiates a new instance of this class.This is a factory method that returns a new instance of this class. The factory should pass any needed dependencies into the constructor of this class, but not the container itself. Every call to this method must return a new instance of this class; that is, it may not implement a singleton.

Parameters
\Symfony\Component\DependencyInjection\ContainerInterface$containerThe service container this instance should use.
}

Implements ContainerInjectionInterface.

view ( EntityInterface  $_entity,
  $view_mode = 'full' 
)

Provides a page to render a single entity.

Parameters
\Drupal\Core\Entity\EntityInterface$_entityThe Entity to be rendered. Note this variable is named $_entity rather than $entity to prevent collisions with other named placeholders in the route.
string$view_mode(optional) The view mode that should be used to display the entity. Defaults to 'full'.
Returns
array A render array as expected by drupal_render().

References Drupal\entityManager(), and EntityInterface\getEntityTypeId().

Here is the call graph for this function:


The documentation for this class was generated from the following file: