-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Description
We should look at ways to move param converters to the framework bundle again. Instead of defining the converters on a per variable basis as in extra bundle @ParamConverter the converters should be registered globally and be matched on the hinted class, ordered by priority of the converters registered:
Say:
public function fooAction(Post $post) { }
Then FrameworkBundle would look if it has one or many parameter converters registered for "Post".
If it has registered converters then based on a priority each parameter converter tries to convert the variable based on the data in the current request. It returns true if it could convert it, false if it couldnt. If no converting mechanism could be found for a class through all the current request data then it should throw an exception.
This would allow to remove tons of glue code with 404 and security handling and such from the controllers, into the param converters making it much more reusable accross different controllers.