• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Need to change the output of two actions

Mr. Goodie2Shoes

Well-known member
To make it clear, there are two actions I need to modify that are on two different controller classes...
So how should I do it? Is there any way to use a listener instead of extending the classes?
And yes, I cannot use pre_dispatch as this needs to be done AFTER the action is executed.


Mr. Goodie2Shoes

Well-known member
You would extend those two controllers. Create a listener for load_class_controller to extend the class. Here is a code example of an extended controller:


You can run the parent function, capture the response, do your own stuff, then return the original response (or modified response).
I know how that works... I am not new you know :p
just thinking if there's any other way to do it... since the output of both actions will be the same if a certain criteria meets I thought it would be better to reduce the size as much as possible...