function DevelCommands::token
Same name in this branch
- 5.x src/Commands/DevelCommands.php \Drupal\devel\Commands\DevelCommands::token()
Same name in other branches
- 4.x src/Commands/DevelCommands.php \Drupal\devel\Commands\DevelCommands::token()
List available tokens.
File
-
src/
Drush/ Commands/ DevelCommands.php, line 221
Class
Namespace
Drupal\devel\Drush\CommandsCode
public function token($options = [
'format' => 'table',
]) : RowsOfFields {
$rows = [];
$all = $this->token
->getInfo();
foreach ($all['tokens'] as $group => $tokens) {
foreach ($tokens as $key => $token) {
$rows[] = [
'group' => $group,
'token' => $key,
'name' => $token['name'],
];
}
}
return new RowsOfFields($rows);
}