Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // SiteController
- public function actionRobots()
- {
- header("Content-type: text/plain");
- Yii::$app->response->data = DbText::widget(['key' => 'frontend.web.robots.txt']);
- Yii::$app->response->format = \yii\web\Response::FORMAT_RAW;
- return Yii::$app->response;
- }
- // /frontend/config/_urlManager.php
- ['pattern' => 'robots', 'route' => 'site/robots', 'suffix' => 'txt'],
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement