Drupal 8  8.0.2
TestController Class Reference
Inheritance diagram for TestController:

Public Member Functions

 __construct (Token $token)
 
 tokenReplace (NodeInterface $node)
 
 tokenReplaceWithoutPassedBubbleableMetadata (NodeInterface $node)
 

Static Public Member Functions

static create (ContainerInterface $container)
 

Protected Attributes

 $token
 

Detailed Description

Provides a test controller for token replacement.

Constructor & Destructor Documentation

__construct ( Token  $token)

Constructs a new TestController instance.

Parameters
\Drupal\Core\Utility\Token$tokenThe token replacement system.

References Drupal\token().

Here is the call graph for this function:

Member Function Documentation

static create ( ContainerInterface  $container)
static

{}

tokenReplace ( NodeInterface  $node)

Provides a token replacement with a node as well as the current user.

This controller passes an explicit bubbleable metadata object to $this->token->replace(), and applies the collected metadata to the render array being built.

Parameters
\Drupal\node\NodeInterface$nodeThe node.
Returns
array The render array.

References Drupal\token().

Here is the call graph for this function:

tokenReplaceWithoutPassedBubbleableMetadata ( NodeInterface  $node)

Provides a token replacement with a node as well as the current user.

This controller is for testing the token service's fallback behavior of applying collected metadata to the currently active render context when an explicit bubbleable metadata object isn't passed in.

Parameters
\Drupal\node\NodeInterface$nodeThe node.
Returns
array The render array.

References Drupal\token().

Here is the call graph for this function:


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