You are here

function simple_mobile_menu_build_tree in Simple Mobile Menu 8.2

Same name and namespace in other branches
  1. 8 simple_mobile_menu.module \simple_mobile_menu_build_tree()

Parameters

array $config:

Return value

mixed

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

File

./simple_mobile_menu.module, line 48
Contains simple_mobile_menu.module

Code

function simple_mobile_menu_build_tree(array $config) {
  $menu_tree = \Drupal::service('simple_mobile_menu.menu_tree');
  $parameters = new MenuTreeParameters();
  $tree = $menu_tree
    ->load($config[1], $parameters);
  $manipulators = [
    [
      'callable' => 'menu.default_tree_manipulators:checkAccess',
    ],
    [
      'callable' => 'menu.default_tree_manipulators:generateIndexAndSort',
    ],
  ];
  $tree = $menu_tree
    ->transform($tree, $manipulators);
  return $menu_tree
    ->build($tree);
}