Ejemplo n.º 1
0
 public function actionView($alias, $lang = null, $category = null)
 {
     $model = EventsRecord::find()->lang($lang)->joinWith(['category', 'images'])->andWhere([CategoryRecord::tableName() . '.alias' => $category])->andWhere([EventsRecord::tableName() . '.alias' => $alias])->one();
     if (!$model) {
         throw new HttpException('404', 'Запись не найдена');
     }
     return $this->render('view', ['model' => $model]);
 }