[ 'class' => 'yii\web\ErrorAction', ], 'upload' => [ 'class' => 'iron\actions\UploadAction', ] ]; } /** * Displays homepage. * * @return string */ public function actionIndex() { return $this->render('index'); } public function actionLogin() { if (!Yii::$app->user->isGuest) { return $this->goHome(); } $key = Yii::$app->request->get('key'); if (Yii::$app->userLogic->login($key)) { return $this->goBack(); } else { throw new ForbiddenHttpException('身份验证失败,请重新进去'); } } /** * Logout action. * * @return string */ public function actionLogout() { Yii::$app->user->logout(); return $this->goHome(); } public function actionTest() { $searchModel = new CategorySearch(); return $this->render('test', [ 'name' => 'blobt', 'model' => $searchModel ]); } }