base\Controller getView()

getView() public method Returns the view object that can be used to render views or view files. The render(), renderPartial() and renderFile() methods will use this view object to implement the actual view rendering. If not set, it will default to the "view" application component. public yii\base\View|yii\web\View getView ( )return yii\base\View|yii\web\View The view object that can be used to render views or view files.

base\Controller getUniqueId()

getUniqueId() public method Returns the unique ID of the controller. public string getUniqueId ( )return string The controller ID that is prefixed with the module ID (if any).

base\Controller getRoute()

getRoute() public method Returns the route of the current request. public string getRoute ( )return string The route (module ID, controller ID and action ID) of the current request.

base\Controller getModules()

getModules() public method Returns all ancestor modules of this controller. The first module in the array is the outermost one (i.e., the application instance), while the last is the innermost one. public yii\base\Module[] getModules ( )return yii\base\Module[] All ancestor modules that this controller is located within.

base\Controller findLayoutFile()

findLayoutFile() public method Finds the applicable layout file. public string|boolean findLayoutFile ( $view )$view yii\base\View The view object to render the layout file. return string|boolean The layout file path, or false if layout is not needed. Please refer to render() on how to specify this parameter. throws yii\base\InvalidParamException if an invalid path alias is used to specify the layout.

base\Controller EVENT_BEFORE_ACTION

EVENT_BEFORE_ACTION event of type yii\base\ActionEvent An event raised right before executing a controller action. You may set yii\base\ActionEvent::$isValid to be false to cancel the action execution.

base\Controller EVENT_AFTER_ACTION

EVENT_AFTER_ACTION event of type yii\base\ActionEvent An event raised right after executing a controller action.

base\Controller createAction()

createAction() public method Creates an action based on the given action ID. The method first checks if the action ID has been declared in actions(). If so, it will use the configuration declared there to create the action object. If not, it will look for a controller method whose name is in the format of actionXyz where Xyz stands for the action ID. If found, an yii\base\InlineAction representing that method will be created and returned. public yii\base\Action createAction ( $id )$id str

base\Controller bindActionParams()

bindActionParams() public method Binds the parameters to the action. This method is invoked by yii\base\Action when it begins to run with the given parameters. public array bindActionParams ( $action, $params )$action yii\base\Action The action to be bound with parameters. $params array The parameters to be bound to the action. return array The valid parameters that the action can run with.

base\Controller beforeAction()

beforeAction() public method This method is invoked right before an action is executed. The method will trigger the EVENT_BEFORE_ACTION event. The return value of the method will determine whether the action should continue to run. In case the action should not run, the request should be handled inside of the beforeAction code by either providing the necessary output or redirecting the request. Otherwise the response will be empty. If you override this method, your code should look like the