class DefaultController in Hierarchical Term Formatter 8
Controller used for previewing nodes in a view mode.
Hierarchy
- class \Drupal\Core\Entity\Controller\EntityViewController implements ContainerInjectionInterface, TrustedCallbackInterface uses DeprecatedServicePropertyTrait
- class \Drupal\node\Controller\NodeViewController
- class \Drupal\hierarchical_term_formatter_test\Controller\DefaultController
- class \Drupal\node\Controller\NodeViewController
Expanded class hierarchy of DefaultController
File
- tests/
modules/ hierarchical_term_formatter_test/ src/ Controller/ DefaultController.php, line 13
Namespace
Drupal\hierarchical_term_formatter_test\ControllerView source
class DefaultController extends NodeViewController {
/**
* Provides a page to render a single entity.
*
* @param \Drupal\node\NodeInterface $node
* The node to be rendered.
* @param \Drupal\Core\Entity\EntityDisplayModeInterface $view_mode
* The view mode that should be used to display the entity.
*
* @return array
* A render array as expected by drupal_render().
*/
public function preview(NodeInterface $node, EntityDisplayModeInterface $view_mode) {
if ($view_mode
->getTargetType() == 'node') {
preg_match('/\\.(.*)/', $view_mode
->id(), $matches);
return parent::view($node, $matches[1]);
}
throw new NotFoundHttpException();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DefaultController:: |
public | function | Provides a page to render a single entity. | |
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 | function | Pre-render callback to build the page title. | |
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. | |
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. |