yii\base\ActionFilter::beforeAction PHP Method

beforeAction() public method

This method is invoked right before an action is to be executed (after all possible filters.) You may override this method to do last-minute preparation for the action.
public beforeAction ( Action $action ) : boolean
$action Action the action to be executed.
return boolean whether the action should continue to be executed.
    public function beforeAction($action)
    {
        return true;
    }

Usage Example

Example #1
0
 public function beforeAction($action)
 {
     if ($this->getIsAjax()) {
         $this->ajaxMode = true;
     }
     return parent::beforeAction($action);
 }
All Usage Examples Of yii\base\ActionFilter::beforeAction