You are here

public static function WeMegaMenuBuilder::getMenuTreeOrder in Drupal Mega Menu 8

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

Get menu tree sorted by weight ascending.

Parameters

string $menu_name: Public static function getMenuTreeOrder menu_name.

array $items: Public static function getMenuTreeOrder items.

int $level: Public static function getMenuTreeOrder level.

Return value

array Public static function getMenuTreeOrder array.

3 calls to WeMegaMenuBuilder::getMenuTreeOrder()
template_preprocess_we_megamenu_backend in ./we_megamenu.module
template_preprocess_we_megamenu_frontend in ./we_megamenu.module
Prepare variables for we_megamenu_frontend.
WeMegaMenuBuilder::initMegamenu in src/WeMegaMenuBuilder.php

File

src/WeMegaMenuBuilder.php, line 96

Class

WeMegaMenuBuilder

Namespace

Drupal\we_megamenu

Code

public static function getMenuTreeOrder($menu_name, $backend, $items = [], $level = 0) {
  $menu = self::getMenuTree($menu_name, $backend, $items = [], $level = 0);
  return self::sortMenuDeep($menu);
}