Пример #1
0
 /**
  * Lists all Card models.
  * @return mixed
  */
 public function actionIndex()
 {
     $model = new Card();
     $model->updateCardStatuses();
     $searchModel = new CardSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
Пример #2
0
 /**
  * Lists all Card models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new CardSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $statusItems = (new CardStatusVal())->find()->all();
     $statusItemsArray = [];
     foreach ($statusItems as $i => $s) {
         $statusItemsArray[$s['attributes']['value']] = $s['attributes']['title'];
     }
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'statusItems' => $statusItemsArray]);
 }