Skip to content
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

Trigger new event to allow updating the response based on view data at one central place #2386

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from

Conversation

stollr
Copy link

@stollr stollr commented Mar 31, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant