Blame view

frontend/controllers/TextController.php 537 Bytes
193ead1b   Administrator   big commti
1
2
3
4
5
6
7
8
9
10
11
12
  <?php
  
  namespace frontend\controllers;
  
  use Yii;
  use yii\web\Controller;
  use common\models\Page;
  use yii\web\HttpException;
  
  class TextController extends Controller
  {
  
076b9c96   Administrator   big commti
13
      public function actionMain()
193ead1b   Administrator   big commti
14
15
16
17
18
19
20
21
22
23
24
      {
  
              if(!$modelText = Page::find()->where(['translit'=>$_GET['translit']])->one())
                      throw new HttpException(404, 'Данной странице не существует!');
              
              return $this->render('index', [
                      'text'=>$modelText,
              ]);
      }    
      
  }