Setting index route in Symfony 2

前端 未结 6 926
孤街浪徒
孤街浪徒 2021-01-22 00:59

I\'ve got Symfony2 installed, and a mostly working site, the only issue is I don\'t know how to set a default route. Currently, I access my index and other routes with the follo

6条回答
  •  终归单人心
    2021-01-22 01:51

    Just create a route that maps to the / pattern :

    # app/config/routing.yml
    homepage:
        pattern:   /
        defaults:  { _controller: AcmeHomeBundle:home:show }
    

    This will route to whatever controller you specify.

提交回复
热议问题