I want to get controller id and its action in my component which is a bootstrap component , but Yii::$app->controller is null when component is run , I think this is due to running before controller runs .
How can get controller id in my bootstrap component ?
or is there another way to run a task after any controllers ?
An event handler can be attached to before action or after action event of the application in your bootstrapping class. ActionEvent holds a reference to the requested action and the controller can be accessed as