Skip to content

[RFC] [DX] [2.7] Simplifying the @Route annotation #12910

Closed
@hhamon

Description

@hhamon

Hi,

I don't know if my proposal really worths it but let's try. Everytime we need to write a new @Route annotation on a controller, we have to provide at least the path and then optional values. In the latters, we often have to give a name to the route. So, writing the following code always bores me:

@Route("/about", name="about")

I was wondering if we could simplify the annotation to the following:

@Route("/about", "about")

By convention, we could admit that if there are two unnamed arguments given to the Route, then it's the path in the first one and the name in the second one. This would make the annotation shorter to write.

What do you think?
Is it possible to implement it with the current implementation of the Doctrine annotations package?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions