public function SimpleMenuBlock::buildSubMenuMenuparent in Simple Mobile Menu 8.2
// Add 'menuparent' class.
Parameters
$items:
Return value
mixed
1 call to SimpleMenuBlock::buildSubMenuMenuparent()
- SimpleMenuBlock::buildMenuStyle in src/
Plugin/ Block/ SimpleMenuBlock.php - Add class to smm menus.
File
- src/
Plugin/ Block/ SimpleMenuBlock.php, line 45
Class
- SimpleMenuBlock
- Provides a Simple Mobile Menu block.
Namespace
Drupal\simple_mobile_menu\Plugin\BlockCode
public function buildSubMenuMenuparent($items) {
foreach ($items as $k => &$item) {
if ($item['below']) {
$item['attributes']
->addClass('has-child');
$item['below'] = $this
->buildSubMenuMenuparent($item['below']);
}
}
return $items;
}