Example #1
0
 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]);
 }
Example #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;
 }
Example #3
0
 public function extraVars()
 {
     return ['album' => \galleryadmin\models\Album::find()->where(['id' => $this->getVarValue('albumId')])->one()];
 }
Example #4
0
 public function actionIndex($catId)
 {
     return $this->render('index', ['catData' => Cat::findOne($catId), 'albenData' => Album::find()->where(['cat_id' => $catId])->all()]);
 }