public static function WeMegaMenuBuilder::countMegamenuSubItem in Drupal Mega Menu 8
Same name and namespace in other branches
- 8.x src/WeMegaMenuBuilder.php \Drupal\we_megamenu\WeMegaMenuBuilder::countMegamenuSubItem()
1 call to WeMegaMenuBuilder::countMegamenuSubItem()
File
- src/
WeMegaMenuBuilder.php, line 748
Class
Namespace
Drupal\we_megamenuCode
public static function countMegamenuSubItem($menu_config, $derivativeId) {
if (!isset($menu_config[$derivativeId])) {
return 0;
}
$megamenu_item = $menu_config[$derivativeId];
$count = 0;
foreach ($megamenu_item['rows_content'] as $i => $cols) {
foreach ($cols as $j => $col) {
$count += isset($col['col_content']) ? count($col['col_content']) : 0;
}
}
return $count;
}