Posts: 10
Threads: 3
Joined: Nov 2019
Reputation:
0
How do I use the $response (ResponseInterface) in the 'after' function for Filters? What are the properties that can be changed here? I need to modify the output. Also, is it possible to view controller variables in the 'after' function?
Posts: 1,285
Threads: 65
Joined: Oct 2014
Reputation:
82
You are given the Response object that contains everything that will be sent to the client, and that's it. So - no controller variables. But you do have the status code, headers, cookies, and the generated HTML.
Take that info, play with it however you need, and return the response object. Your modified response is what is returned to the client at the point.
Posts: 10
Threads: 3
Joined: Nov 2019
Reputation:
0
Boom! That's what I needed. Thank you!