public function SystemMenuBlock::build

Builds and returns the renderable array for this block plugin.

Return value

array A renderable array representing the content of the block.

Overrides BlockPluginInterface::build

See also

\Drupal\block\BlockRenderController

1 method overrides SystemMenuBlock::build()
MenuBlock::build in drupal/core/modules/menu/lib/Drupal/menu/Plugin/Block/MenuBlock.php
Builds and returns the renderable array for this block plugin.

File

drupal/core/modules/system/lib/Drupal/system/Plugin/Block/SystemMenuBlock.php, line 38
Contains \Drupal\system\Plugin\Block\SystemMenuBlock.

Class

SystemMenuBlock
Provides a 'System Menu' block.

Namespace

Drupal\system\Plugin\Block

Code

public function build() {
  list($plugin, $derivative) = explode(':', $this
    ->getPluginId());

  // Derivatives are prefixed with 'menu-'.
  $menu = substr($derivative, 5);
  return menu_tree($menu);
}