8000 [FrameworkBundle] Add new "routing.annotated_controller" service tag · Issue #21282 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[FrameworkBundle] Add new "routing.annotated_controller" service tag #21282
Closed
@nicolas-grekas

Description

@nicolas-grekas
Q A
Feature request? yes
RFC? yes
Symfony version 3.3

When one defines a controller as a service, it would be nice to be able to wire it with routing in a snap of a tag.
eg

services:
    Controller\SomeController:
        tags:
            - name: routing.annotated_controller
              prefix: /foo #optional, maybe the other route params as other tag attributes if worth it?

Using this tag, the routes would be specified as annotations on the related class+methods (which means moving AnnotatedRouteControllerLoader to FrameworkBundle.

This would allow bundles to take control of the wiring of their routing configuration. This means that just by enabling a bundle, its routing config would be done. Of course, each bundle could provide config to change the prefix, disable/enable routes conditionally, etc.

I also think that this would mean one less file to look at for new comers (I mean routing.yml.)

If someone would like to give it a try, please do :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFCRFC = Request For Comments (proposals about features that you want to be discussed)

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0