PHP before action and after action
问题 I would like to know how can I do something similar with beforeAction() and afterAction() from Yii. I need to have the same behavior in my PHP like those two functions from Yii and I don't know where to start from. What I really need in my case is that every time a function executes, it has to reload some parameters and after the function executes it's code, it has to set them again. The first action can be done in the constructor but the second one can only be done using a callback and this