Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[FrameworkBundle] Add new "routing.annotated_controller" service tag #21282

Copy link
Copy link
Closed
@nicolas-grekas

Description

@nicolas-grekas
Issue body actions
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)RFC = 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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.