How to build "filters" like Yii 1.x in Yii 2.0

Hi There, I am working on rebuilt my RESTful API from Yii 1.x to Yii 2.0, I have a question about the "filters".

A. Yii 1.x

I used filters to change some controller’s priorities in controller, and yes, it’s just like what we did in beforeAction, but I have a lot of filters so I can’t move all into the beforeAction function, and the run logic for different actions too.

B. Yii 2.x

I found I need use behavior to do the same thing, but I can’t do $this->modelName = ‘post’ (ps controller.modelName) in ActionFilter class, I also know __get and __set (80% my priorities are protected or private), but it’s not good enough for me, because I have too much priorities.

so, can anyone show me something about how to do the same thing in Yii 2.x?

thx again, I will carry on research, I will post back if I found any solution first.

nice day.