Routing in Symfony2

前端 未结 10 1668
抹茶落季
抹茶落季 2021-02-05 04:30

How to setup default routing in Symfony2?

In Symfony1 it looked something like this:

homepage:
  url:   /
  param: { module: default, action: index }

de         


        
10条回答
  •  别那么骄傲
    2021-02-05 05:05

    Create a default route is not a good way of programming. Why? Because for this reason was implemented Exception. Symfony2 is built just to do right things in the right way.

    If you want to redirect all "not found" routes you should use exception, like NotFound404 or something similar. You can even customise this page at your own.

    One route is for one purpose. Always. Other think is bad.

提交回复
热议问题