123456789101112131415161718192021222324 |
- <?php
- namespace app\controllers;
- use app\models\Person;
- use yii\web\Controller;
- use yii\web\NotFoundHttpException;
- class PersonController extends \yii\web\Controller
- {
- public function actionIndex()
- {
- return $this->render('index');
- }
- public function actionPerson($person){
- $model = Person::findOne(['alias'=>$person]);
- if( ( !$model instanceof Person ) || $model->show == 'N' ){
- throw new NotFoundHttpException("Статья не найдена");
- }
- return $this->render("person",["model"=>$model]);
- }
- }
|