class ManageDisplayEntityViewController in Manage display 8
Defines a controller to render a single node.
Hierarchy
- class \Drupal\Core\Entity\Controller\EntityViewController implements ContainerInjectionInterface, TrustedCallbackInterface uses DeprecatedServicePropertyTrait
- class \Drupal\manage_display_fix_title\Controller\ManageDisplayEntityViewController
Expanded class hierarchy of ManageDisplayEntityViewController
File
- modules/
manage_display_fix_title/ src/ Controller/ ManageDisplayEntityViewController.php, line 11
Namespace
Drupal\manage_display_fix_title\ControllerView source
class ManageDisplayEntityViewController extends EntityViewController {
/**
* Pre-render callback to build the page title.
*
* @param array $page
* A page render array.
*
* @return array
* The changed page render array.
*/
public function buildTitle(array $page) {
$entity_type = $page['#entity_type'];
$entity = $page['#' . $entity_type];
if ($entity instanceof FieldableEntityInterface) {
$label_field = $entity
->getEntityType()
->getKey('label');
$page_title = [
'#theme' => 'entity_page_title',
'#title' => $entity
->label(),
'#entity' => $entity,
'#view_mode' => $page['#view_mode'],
];
$page['#title'] = $this->renderer
->render($page_title);
unset($page[$label_field]);
}
return $page;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DeprecatedServicePropertyTrait:: |
public | function | Allows to access deprecated/removed properties. | |
EntityViewController:: |
protected | property | ||
EntityViewController:: |
protected | property | The entity type manager. | |
EntityViewController:: |
protected | property | The renderer service. | |
EntityViewController:: |
public static | function |
Instantiates a new instance of this class. Overrides ContainerInjectionInterface:: |
2 |
EntityViewController:: |
public static | function |
Lists the trusted callbacks provided by the implementing class. Overrides TrustedCallbackInterface:: |
|
EntityViewController:: |
public | function | Provides a page to render a single entity. | 2 |
EntityViewController:: |
public | function | Provides a page to render a single entity revision. | |
EntityViewController:: |
public | function | Creates an EntityViewController object. | 2 |
ManageDisplayEntityViewController:: |
public | function |
Pre-render callback to build the page title. Overrides EntityViewController:: |
|
TrustedCallbackInterface:: |
constant | Untrusted callbacks throw exceptions. | ||
TrustedCallbackInterface:: |
constant | Untrusted callbacks trigger silenced E_USER_DEPRECATION errors. | ||
TrustedCallbackInterface:: |
constant | Untrusted callbacks trigger E_USER_WARNING errors. |