KnpLabs/KnpMenu — Issue #37: [HELP] Integration of KnpMenu childrenAttributes with Twig
Author: cedriclombardot
Created: 2012-02-21 21:11:06+00:00
State: open

Hi,

I have implemented a first time KnpMenu like that https://github.com/cedriclombardot/AdmingeneratorGeneratorBundle/blob/master/Menu/DefaultMenuBuilder.php#L25 but due to last change with `childrenAttributes` i have set

``` php
factory->createItem('root', array('childrenAttributes' => array('id' => 'main_navigation', 'class'=>'menu')));
````

instead of

``` php
factory->createItem('root');
$menu->setAttributes(array('id' => 'main_navigation', 'class'=>'menu'));
```

But when i add `{{ dump(item.childrenAttributes) }}` into `knp_menu.html.twig` Line 17 twig tell me thats an empty array !

What i miss to update ?

Thanks in advance