function drush_devel_token

Same name in other branches
  1. 6.x-1.x devel.drush.inc \drush_devel_token()
  2. 7.x-1.x devel.drush.inc \drush_devel_token()

Command callback. List available tokens.

File

drush/devel.drush8.inc, line 197

Code

function drush_devel_token() {
    $rows[] = array(
        dt('Group'),
        dt('Token'),
        dt('Name'),
    );
    $all = \Drupal::token()->getInfo();
    foreach ($all['tokens'] as $group => $tokens) {
        foreach ($tokens as $key => $token) {
            $rows[] = array(
                $group,
                $key,
                $token['name'],
            );
        }
    }
    drush_print_table($rows, TRUE);
}