Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. BlockLibraryController.php

function BlockLibraryController::buildLocalActions

Builds the local actions for this listing.

Return value

array An array of local actions for this listing.

1 call to BlockLibraryController::buildLocalActions()
BlockLibraryController::listBlocks in core/modules/block/src/Controller/BlockLibraryController.php
Shows a list of blocks that can be added to a theme's layout.

File

core/modules/block/src/Controller/BlockLibraryController.php, line 175

Class

BlockLibraryController
Provides a list of block plugins to be added to the layout.

Namespace

Drupal\block\Controller

Code

protected function buildLocalActions() {
    $build = $this->localActionManager
        ->getActionsForRoute($this->routeMatch
        ->getRouteName());
    // Without this workaround, the action links will be rendered as <li> with
    // no wrapping <ul> element.
    if (!empty($build)) {
        $build['#prefix'] = '<ul class="action-links">';
        $build['#suffix'] = '</ul>';
    }
    return $build;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal