You are here

function build_hooks_toolbar in Build Hooks 8

Same name and namespace in other branches
  1. 8.2 build_hooks.module \build_hooks_toolbar()
  2. 3.x build_hooks.module \build_hooks_toolbar()

Implements hook_toolbar().

File

./build_hooks.module, line 45
Contains build_hooks.module.

Code

function build_hooks_toolbar() {
  if (getTriggerService()
    ->showMenu()) {
    $items['build_hooks'] = [
      '#cache' => [
        'contexts' => [
          'user.permissions',
        ],
      ],
      '#weight' => 999,
      '#type' => 'toolbar_item',
      'tab' => [
        '#type' => 'link',
        '#title' => t('Execute Build Hook'),
        '#url' => Url::fromRoute('build_hooks.trigger_controller_execute'),
      ],
    ];
    return $items;
  }
}