跳转出现错误?
class HelloController extends Controller { public function actionIndex() { $res=\Yii::$app->response; //页面跳转 //$res->headers->add('location','http://www.baidu.com'); //或者 $this->redirect('http://www.baidu.com',301); } }
浏览器访问报错:
Calling unknown method: app\controllers\HelloController::redirect()