add active class to link with sf2 and twig

前端 未结 10 911
故里飘歌
故里飘歌 2020-12-23 13:48

following simple code:

  • List
  • is there a simple way to add an cl

    10条回答
    •  星月不相逢
      2020-12-23 14:35

      This is how I do it (using Symfony 2.6)

    • Student
    • '_homepage' is the name of route in routing.yml of your bundle and the route looks like this

      _homepage:
          path:     /
          defaults: { _controller: CoreBundle:Default:index }
      

    提交回复
    热议问题