public function actionIndex($albumId)
 {
     $model = \galleryadmin\models\Album::find()->where(['id' => $albumId])->one();
     $this->view->registerMetaTag(['name' => 'description', 'content' => $model->description]);
     $this->view->title = $model->title;
     return $this->render('index', ['model' => $model]);
 }
Exemple #2
0
 public function eventBeforeDelete($event)
 {
     $items = Album::find()->where(['cat_id' => $this->id])->all();
     if (count($items) > 0) {
         $this->addError('id', Module::t('cat_delete_error'));
         $event->isValid = false;
         return;
     }
     $event->isValid = true;
 }
Exemple #3
0
 public function extraVars()
 {
     return ['album' => \galleryadmin\models\Album::find()->where(['id' => $this->getVarValue('albumId')])->one()];
 }
Exemple #4
0
 public function actionIndex($catId)
 {
     return $this->render('index', ['catData' => Cat::findOne($catId), 'albenData' => Album::find()->where(['cat_id' => $catId])->all()]);
 }