TextController.php 537 Bytes
<?php

namespace frontend\controllers;

use Yii;
use yii\web\Controller;
use common\models\Page;
use yii\web\HttpException;

class TextController extends Controller
{

    public function actionMain()
    {

            if(!$modelText = Page::find()->where(['translit'=>$_GET['translit']])->one())
                    throw new HttpException(404, 'Данной странице не существует!');
            
            return $this->render('index', [
                    'text'=>$modelText,
            ]);
    }    
    
}