public function actionIndex($albumId)
 {
     $model = Album::find()->where(['id' => $albumId])->one();
     if (!$model) {
         throw new NotFoundHttpException("Unable to find requested gallery collection.");
     }
     $this->view->registerMetaTag(['name' => 'description', 'content' => $model->description]);
     $this->view->title = $model->title;
     return $this->render('index', ['model' => $model]);
 }
示例#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;
 }
 public function extraVars()
 {
     return ['album' => Album::find()->where(['id' => $this->getVarValue('albumId')])->one()];
 }
 /**
  * Get all collections for a specfici categorie
  *
  * @param integer $catId
  */
 public function actionDataByCategorie($catId)
 {
     return $this->render('data_by_categorie', ['data' => Album::find()->where(['cat_id' => $catId])->orderBy(['is_highlight' => SORT_DESC, 'sort_index' => SORT_ASC])->all()]);
 }
 public function actionIndex($catId)
 {
     return $this->render('index', ['catData' => Cat::findOne($catId), 'albenData' => Album::find()->where(['cat_id' => $catId])->orderBy(['is_highlight' => SORT_DESC, 'sort_index' => SORT_ASC])->all()]);
 }