Ordering of routes using annotations

后端 未结 3 1620
生来不讨喜
生来不讨喜 2020-12-17 15:34

The usual solution when you create routes in symfony and you want to have one route like

/{username}

so that it does not conflict with othe

3条回答
  •  生来不讨喜
    2020-12-17 15:44

    In the context of a controller, the order of action methods defines the order of routes. In the context of the whole application, you can import each controller explicitly to control the order, for example:

    Home:
        resource: "\Vendor\Controller\HomeController"
        type: annotation
    
    Security:
        resource: "\Vendor\Controller\SecurityController"
        type: annotation
    
    security.log_out:
        pattern: "/logout"
    
    User:
        resource: "\Vendor\Controller\UserController"
        type: annotation
    

提交回复
热议问题