You are here

public function TreeBuilderInterface::buildRenderable in Token 8

Build a render array with token tree built as per specified options.

Parameters

array $token_types: An array containing token types that should be shown in the tree.

array $options: (optional) An associative array to control which tokens are shown and how. The properties available are:

  • 'global_types' (defaults to TRUE): Show all global token types along with the specified types.
  • 'click_insert' (defaults to TRUE): Include classes and caption to show allow inserting tokens in fields by clicking on them.
  • 'show_restricted' (defaults to FALSE): Show restricted tokens in the tree.
  • 'show_nested' (defaults to FALSE): If this token is nested and should therefor not show on the token browser as a top level token.
  • 'recursion_limit' (defaults to 3): Only show tokens up to the specified depth.

Return value

array Render array for the token tree.

1 method overrides TreeBuilderInterface::buildRenderable()
TreeBuilder::buildRenderable in src/TreeBuilder.php
Build a render array with token tree built as per specified options.

File

src/TreeBuilderInterface.php, line 65

Class

TreeBuilderInterface

Namespace

Drupal\token

Code

public function buildRenderable(array $token_types, array $options = []);