Return redirect action to controller from other model function

Handsome.php (model)

public function validateHandsomeLvl()
{
    if(1==1)
            return \yii\web\Controller::redirect(['site/sorry']); <== Error Highlight
    else
            return array();
}

AbcController.php (controller)

use app\models\Handsome;

public function actionIndex()
{
  $hs = new Handsome();
  $hsLvl = $auth->validateHandsomeLvl();
  if(is_array($hsLvl ))
      return $this->render('index');
  else
      return $hsLvl;
}

May I know why when I access abc/index in localhost, it is working fine.
However when I access it in internet, I got error “Non-static method yii\web\Controller::redirect() should not be called statically”?

Although I still not sure why, but I found a workaround :sweat_smile:

I think the error is pretty clear you are trying to call a non static method statically which means you should create an instance of controller class and call redirect on that if you need to return a redirect from model (which btw I think is also not very good idea) return the response object like so

return Yii::$app->getResponse()->redirect($url)