You are here

public function NameFormatParser::renderableTokenHelp in Name Field 8

Helper function to provide name format token help.

Return value

array A renderable array of tokens in a details element..

File

src/NameFormatParser.php, line 632

Class

NameFormatParser
Converts a name from an array of components into a defined format.

Namespace

Drupal\name

Code

public function renderableTokenHelp() {
  return [
    '#type' => 'details',
    '#title' => $this
      ->t('Format string help'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#parents' => [],
    'format_parameters' => [
      '#theme' => 'name_format_parameter_help',
      '#tokens' => $this
        ->tokenHelp(),
    ],
  ];
}