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