/**
  * Lists all Category models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new CategorySearch();
     $dataProvider = $searchModel->search(Yii::$app->request->getQueryParams());
     return $this->render('index', ['dataProvider' => $dataProvider, 'searchModel' => $searchModel]);
 }
Example #2
0
 public static function getCategoryList($idCat = null)
 {
     $query = \biz\master\models\searchs\Category::find();
     if ($idCat !== null) {
         $query->where(['id_category' => $idCat]);
     }
     return ArrayHelper::map($query->asArray()->all(), 'id_category', 'nm_category');
 }