You are here

public function SimpleMenuBlock::_build_menu_style in Simple Mobile Menu 8

add class to smm menus.

Parameters

$tree:

$block_config:

Return value

mixed

1 call to SimpleMenuBlock::_build_menu_style()
SimpleMenuBlock::build in src/Plugin/Block/SimpleMenuBlock.php
Builds and returns the renderable array for this block plugin.

File

src/Plugin/Block/SimpleMenuBlock.php, line 75

Class

SimpleMenuBlock
Provides a Simple Mobile Menu block.

Namespace

Drupal\simple_mobile_menu\Plugin\Block

Code

public function _build_menu_style($tree, $block_config) {

  // add default class.
  $tree['#attributes']['class'][] = 'mobile_menu';

  // $tree['#attributes']['class'][] = 'smm-menu-' . $block_config['menu_name'];
  // add 'menuparent' class.
  $tree['#items'] = $this
    ->_build_sub_menu_menuparent($tree['#items']);
  return $tree;
}