You are here

public static function WeMegaMenuBuilder::renderWeMegaMenuBlock in Drupal Mega Menu 8.x

Same name and namespace in other branches
  1. 8 src/WeMegaMenuBuilder.php \Drupal\we_megamenu\WeMegaMenuBuilder::renderWeMegaMenuBlock()

Render Drupal 8 Mega Menu blocks.

Parameters

string $menu_name: Public static function renderWeMegaMenuBlock menu_name.

string $theme: Public static function renderWeMegaMenuBlock theme

Return value

array Public static function renderWeMegaMenuBlock array.

1 call to WeMegaMenuBuilder::renderWeMegaMenuBlock()
WeMegaMenuAdminController::resetConfigWeMegaMenu in src/Controller/WeMegaMenuAdminController.php
A function reset menu config.

File

src/WeMegaMenuBuilder.php, line 280

Class

WeMegaMenuBuilder

Namespace

Drupal\we_megamenu

Code

public static function renderWeMegaMenuBlock($menu_name, $theme) {
  return [
    '#theme' => 'we_megamenu_frontend',
    '#block_theme' => $theme,
    '#menu_name' => $menu_name,
    '#section' => 'admin',
    '#blocks' => WeMegaMenuBuilder::getAllBlocks(),
  ];
}