Commit 82a330b95b2598a0453faf6752664001e451c8be
1 parent
1083271e
- загрузка страниц
Showing
1 changed file
with
0 additions
and
33 deletions
Show diff stats
frontend/controllers/SiteController.php
@@ -78,39 +78,6 @@ class SiteController extends Controller | @@ -78,39 +78,6 @@ class SiteController extends Controller | ||
78 | */ | 78 | */ |
79 | public function actionIndex() | 79 | public function actionIndex() |
80 | { | 80 | { |
81 | - // парсим URL, находим контроллер и подключаем view-файл | ||
82 | - if (($url = substr(yii::$app->request->url, 1)) == '') | ||
83 | - { | ||
84 | - $url = '/'; | ||
85 | - } | ||
86 | - | ||
87 | - // находим страницу | ||
88 | - if ($page = Page::getPageByUrl ($url)) | ||
89 | - { | ||
90 | - // проверяем или не закрыта и есть все файлы | ||
91 | - if (Page::isShow ($page) | ||
92 | - && $page['template_file'] != NULL | ||
93 | - && is_file (yii::$app->viewPath.'/'.$page['template_file'].'.php')) | ||
94 | - { | ||
95 | - // загружаем роуты | ||
96 | -/* | ||
97 | - yii::$app->UrlManager->rules += [ | ||
98 | - 'maгаз' => 'shop/categoty', | ||
99 | - ]; | ||
100 | -*/ | ||
101 | - | ||
102 | - list ($controller, $view) = explode ('/', $page['template_file']); | ||
103 | - | ||
104 | - // подключаем | ||
105 | - return Yii::$app->runAction($page['template_file'], [ | ||
106 | - 'controller_name' => $controller, | ||
107 | - 'view' => $view, | ||
108 | - 'page_id' => $page['page_id'], | ||
109 | - 'template_file' => $page['template_file'], | ||
110 | - ]); | ||
111 | - } | ||
112 | - } | ||
113 | - | ||
114 | return $this->render('index'); | 81 | return $this->render('index'); |
115 | } | 82 | } |
116 | 83 |