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
Post a Comment