php - Symfony 2 KNP Menu: add CSS class to link -


i'm using knpmenubundle symfony2 , couldn't find way add css class menu generated links.

what tried set class child attribute, not given link possible children menus (submenus).

    $menu->addchild('agb', array('uri' => '#'))         ->setattribute('divider_append', true)         ->setchildenattribute('class', 'childclass'); 

this result following html

<li>     <a href="#"> agb </a>     <ul class="childclass">         ....     </ul> </li> 

but need this:

<li>     <a href="#" class="childclass"> agb </a>     <ul>         ....     </ul> </li> 

how can this?

$menu->addchild('agb', array('uri' => '#'))     ->setattribute('divider_append', true)     ->setlinkattribute('class', 'childclass'); 

easy :)


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -