EntityViewController
class EntityViewController implements ContainerInjectionInterface, TrustedCallbackInterface (View source)
Defines a generic controller to render a single entity.
Properties
| protected EntityTypeManagerInterface | $entityTypeManager | The entity type manager. |
|
| protected RendererInterface | $renderer | The renderer service. |
Methods
Creates an EntityViewController object.
Instantiates a new instance of this class.
Pre-render callback to build the page title.
Provides a page to render a single entity.
Lists the trusted callbacks provided by the implementing class.
Provides a page to render a single entity revision.
Details
__construct(EntityTypeManagerInterface $entity_type_manager, RendererInterface $renderer)
Creates an EntityViewController object.
static
create(ContainerInterface $container)
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.
array
buildTitle(array $page)
Pre-render callback to build the page title.
array
view(EntityInterface $_entity, string $view_mode = 'full')
Provides a page to render a single entity.
static string[]
trustedCallbacks()
Lists the trusted callbacks provided by the implementing class.
Trusted callbacks are public methods on the implementing class and can be invoked via \Drupal\Core\Security\DoTrustedCallbackTrait::doTrustedCallback().
array
viewRevision(EntityInterface $_entity_revision, string $view_mode = 'full')
Provides a page to render a single entity revision.