如何更改“当前"类到“活动"在 KNPMenuBundle 中 [英] How to change the "current" class to "active" in KNPMenuBundle

查看:9
本文介绍了如何更改“当前"类到“活动"在 KNPMenuBundle 中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道,将当前"类更改为活动"以便 Bootstrap 可以正常使用它的最佳方法是什么?

I was wondering, what is the best way to change the "current" class to be "active" so Bootstrap will work correctly with it?

我想过复制和覆盖 knp_menu_html.twig 但我认为这不是最好的方法...

I thought about copying and overriding the knp_menu_html.twig but i think its not the best way...

无论如何做得更好?

推荐答案

你可以这样传递:

{{ knp_menu_render('AcmeDemoBundle:Builder:mainMenu', {'currentClass': 'active'}) }}

这篇关于如何更改“当前"类到“活动"在 KNPMenuBundle 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆