public function setConsumers() { $consumers = Consumers::find()->all(); foreach ($consumers as $objConsumer) { $this->_consumers[] = $objConsumer->getOptionsToArray(); } }
/** * Lists all Consumers models. * @return mixed */ public function actionIndex() { $dataProvider = new ActiveDataProvider(['query' => Consumers::find()]); return $this->render('index', ['dataProvider' => $dataProvider]); }