src/Menu/MenuBuilder.php
public function setRecursiveAttribute(ItemInterface $menu, array $attr)
    {
        $itemIterator = new RecursiveItemIterator($menu->getIterator());

        $iterator = new \RecursiveIteratorIterator($itemIterator, \RecursiveIteratorIterator::SELF_FIRST);
        foreach ($iterator as $menuItem) {
            /* @var ItemInterface $menuItem */
            $menuItem->setChildrenAttributes($attr);
        }
    }
public function setRecursiveAttribute(ItemInterface $menu, array $attr)
    {
        $itemIterator = new RecursiveItemIterator($menu->getIterator());

        $iterator = new \RecursiveIteratorIterator($itemIterator, \RecursiveIteratorIterator::SELF_FIRST);
        foreach ($iterator as $menuItem) {
            /* @var ItemInterface $menuItem */
            $menuItem->setChildrenAttributes($attr);
        }
    }
public function setRecursiveAttribute ( ItemInterface $ menu , array $ attr ) { $ itemIterator = new RecursiveItemIterator ( $ menu -> getIterator ( ) ) ; $ iterator = new \ RecursiveIteratorIterator ( $ itemIterator , \ RecursiveIteratorIterator :: SELF_FIRST ) ; foreach ( $ iterator as $ menuItem ) { /* @var ItemInterface $menuItem */ $ menuItem -> setChildrenAttributes ( $ attr ) ; } }
Recursively set attributes on an item and its' children.

@param ItemInterface $menu
@param array $attr
Recursively set attributes on an item and its children .