public function run() { $producers = Producer::find()->where(['status' => Producer::STATUS_ENABLED])->all(); $categories = Category::find()->where(['status' => Category::STATUS_ENABLED])->all(); return $this->render('sidebar', ['producers' => $producers, 'categories' => $categories]); }
public function actionList() { $dataProvider = new ActiveDataProvider(['query' => Producer::find()]); return $this->render('list', ['dataProvider' => $dataProvider]); }