-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set defaults on a per class basis #1
Comments
i dont really understand but like: #[Route\Defaults(prefix: 'uri-prefix', format: 'json')
class MyController
{
#[Route('lol', method: "GET")
public function lolAction()
{}
} would result in |
Why not re-use the existing names from the routing config (it's not super nice, but at least that would make it consistent), i.e.: class MyController
{
#[Route(uriPatter: "foo", defaults: ['@format': 'json'], httpMethods: ['GET'])
public function lolAction()
{}
} |
My attempt to make config key more simple. |
Exactly, routes for this class all have |
yes id consider it more clean to have a separate annotation for this than to reuse the existing one though i dont like your proposed name ^^ naming things i know ... |
I like |
However, the question if |
Route Defaults - the idea from the
Say it out load: Route Defaults is prefix api/v1 and format json and on the method
Route is POST contacts Together it will be be Route is POST api/v1/contacts format json |
And for @lorenzulrich example: on the class
and on the method
Route is GET and POST contacts Together it will be be Route is GET and POST api/v1/contacts format json |
I would like to see the first implementation of annotation routes be close to the yaml configuration and not introduce other new features yet. We may want that later after actually working with route annotations. If it can be treated as a seperate feature it probably should. |
How about we introduce a
Defaults
annotation kind of like thisThe text was updated successfully, but these errors were encountered: