class ManageDisplayNodeViewController 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\node\Controller\NodeViewController
- class \Drupal\manage_display_fix_title\Controller\ManageDisplayNodeViewController
- class \Drupal\node\Controller\NodeViewController
Expanded class hierarchy of ManageDisplayNodeViewController
File
- modules/
manage_display_fix_title/ src/ Controller/ ManageDisplayNodeViewController.php, line 11
Namespace
Drupal\manage_display_fix_title\ControllerView source
class ManageDisplayNodeViewController extends NodeViewController {
/**
* 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');
if ($label_field) {
$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 |
Lists the trusted callbacks provided by the implementing class. Overrides TrustedCallbackInterface:: |
|
EntityViewController:: |
public | function | Provides a page to render a single entity revision. | |
ManageDisplayNodeViewController:: |
public | function |
Pre-render callback to build the page title. Overrides EntityViewController:: |
|
NodeViewController:: |
protected | property | The current user. | |
NodeViewController:: |
protected | property | The entity repository service. | |
NodeViewController:: |
public static | function |
Instantiates a new instance of this class. Overrides EntityViewController:: |
|
NodeViewController:: |
public | function | The _title_callback for the page that renders a single node. | |
NodeViewController:: |
public | function |
Provides a page to render a single entity. Overrides EntityViewController:: |
|
NodeViewController:: |
public | function |
Creates an NodeViewController object. 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. |