Refer to the controller within view in yii2

We can get the controller object by the expression $this->context. And as a result, it is possible to access any properties or methods of the controller in the view, such as the controller ID shown in the following: