Currently it is not easily possible to access the response object and the view at the same time. I have the use case, that I want to return a paginated list of data (using the KnpPaginationBundle) so I pass a pagination wrapper to the view layer.
The response has to contain some meta data (in fact I am using the Link header similar to Githubs API), but I want to do this decoration at one central place and not in each controller. This is currently not possible. So I added a new event that is triggered in the createResponse method of the ViewHandler.
I think this addition could be useful for others, too. So I hope this gets merged.
Currently it is not easily possible to access the response object and the view at the same time. I have the use case, that I want to return a paginated list of data (using the KnpPaginationBundle) so I pass a pagination wrapper to the view layer.
The response has to contain some meta data (in fact I am using the
Link
header similar to Githubs API), but I want to do this decoration at one central place and not in each controller. This is currently not possible. So I added a new event that is triggered in thecreateResponse
method of theViewHandler
.I think this addition could be useful for others, too. So I hope this gets merged.