/** * return robots.txt */ public function actionGetRobots() { $robots = Robots::getRobots(); $response = \Yii::$app->response; $response->headers->set('Content-Type', 'text/plain'); $response->format = \yii\web\Response::FORMAT_RAW; $response->data = $robots; \Yii::$app->end(); }