function LocalActionsBlock::build

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Menu/Plugin/Block/LocalActionsBlock.php \Drupal\Core\Menu\Plugin\Block\LocalActionsBlock::build()
  2. 10 core/lib/Drupal/Core/Menu/Plugin/Block/LocalActionsBlock.php \Drupal\Core\Menu\Plugin\Block\LocalActionsBlock::build()
  3. 11.x core/lib/Drupal/Core/Menu/Plugin/Block/LocalActionsBlock.php \Drupal\Core\Menu\Plugin\Block\LocalActionsBlock::build()

Overrides BlockPluginInterface::build

File

core/lib/Drupal/Core/Menu/Plugin/Block/LocalActionsBlock.php, line 78

Class

LocalActionsBlock
Provides a block to display the local actions.

Namespace

Drupal\Core\Menu\Plugin\Block

Code

public function build() {
    $route_name = $this->routeMatch
        ->getRouteName();
    $local_actions = $this->localActionManager
        ->getActionsForRoute($route_name);
    return $local_actions;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.