3133 - Отключение sitemap.xml страниц на анг.

parent a9f97dc6
......@@ -75,9 +75,9 @@ class SiteController extends FrontendController
public function actions()
{
return [
/*'error' => [
'error' => [
'class' => 'yii\web\ErrorAction',
],*/
],
'captcha' => [
'class' => 'yii\captcha\CaptchaAction',
'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null,
......@@ -85,20 +85,20 @@ class SiteController extends FrontendController
];
}
public function actionError()
{
$model = \common\modules\content\models\CoContent::findOne(['url' => 'site/error']);
if(!($lang = $model->lang) || $lang->hidden) {
throw new NotFoundHttpException('Page not found!');
}
$content = $lang->getFinishedContent();
$this->meta_title = $model->metaTag->title;
$this->meta_description = $model->metaTag->description;
$this->meta_keywords = $model->metaTag->keywords;
Yii::$app->response->setStatusCode(404);
return $this->render('error', ['content'=>$content]);
}
// public function actionError()
// {
// $model = \common\modules\content\models\CoContent::findOne(['url' => 'site/error']);
//
// if(!($lang = $model->lang) || $lang->hidden) {
// throw new NotFoundHttpException('Page not found!');
// }
// $content = $lang->getFinishedContent();
// $this->meta_title = $model->metaTag->title;
// $this->meta_description = $model->metaTag->description;
// $this->meta_keywords = $model->metaTag->keywords;
// Yii::$app->response->setStatusCode(404);
// return $this->render('error', ['content'=>$content]);
// }
public function actionIndex()
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment