You are here

public function TreeBuilder::buildAllRenderable in Token 8

Build a render array with token tree containing all possible tokens.

Parameters

array $options: (optional) An associative array to control which tokens are shown and how. The properties available are: See \Drupal\token\TreeBuilderInterface::buildRenderable() for details.

Return value

array Render array for the token tree.

Overrides TreeBuilderInterface::buildAllRenderable

File

src/TreeBuilder.php, line 108

Class

TreeBuilder

Namespace

Drupal\token

Code

public function buildAllRenderable(array $options = []) {
  $info = $this->tokenService
    ->getInfo();
  $token_types = array_keys($info['types']);

  // Disable merging in global types as we will be adding in all token types
  // explicitly. There is no difference in leaving this set to TRUE except for
  // an additional method call which is unnecessary.
  $options['global_types'] = FALSE;
  return $this
    ->buildRenderable($token_types, $options);
}