/** * Update robots.txt * @return string|\yii\web\Response * @throws \yii\web\NotFoundHttpException */ public function actionRobots() { $model = Robots::getModel(); if ($model === null) { $model = new Robots(); } if (Yii::$app->request->isPost) { if ($model->load(Yii::$app->request->post()) && $model->validate()) { $model->save(); return $this->refresh(); } } return $this->render('robots', ['model' => $model]); }