public function actionIndex() { return $this->render('index', ['catData' => Cat::find()->orderBy(['title' => SORT_ASC])->all()]); }
public function ngRestAttributeTypes() { return ['title' => 'text', 'description' => 'textarea', 'cover_image_id' => 'image', 'cat_id' => ['selectModel', 'modelClass' => Cat::className(), 'valueField' => 'id', 'labelField' => 'title'], 'sort_index' => 'number', 'is_highlight' => 'toggleStatus']; }
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()]); }