You are here

public function TBMegaMenuBuilder::renderBlock in The Better Mega Menu 8

Same name and namespace in other branches
  1. 2.x src/TBMegaMenuBuilder.php \Drupal\tb_megamenu\TBMegaMenuBuilder::renderBlock()

Create block which using tb_megamenu.

Parameters

string $menu_name: The menu machine name.

string $theme: The theme machine name.

Return value

array The render array.

Overrides TBMegaMenuBuilderInterface::renderBlock

File

src/TBMegaMenuBuilder.php, line 209

Class

TBMegaMenuBuilder
Defines a TBMegaMenuBuilder.

Namespace

Drupal\tb_megamenu

Code

public function renderBlock(string $menu_name, string $theme) {
  return [
    '#theme' => 'tb_megamenu',
    '#menu_name' => $menu_name,
    '#block_theme' => $theme,
    '#section' => 'backend',
    '#post_render' => [
      '\\Drupal\\tb_megamenu\\Controller\\TBMegaMenuController::tbMegamenuAttachNumberColumns',
    ],
  ];
}