/** * Lists all Cbs models. * @return mixed */ public function actionIndex() { $searchModel = new ApisSearch(); $queryParams = array_merge(['ApisSearch' => ['cbs' => 1]], Yii::$app->request->getQueryParams()); $dataProvider = $searchModel->search($queryParams); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }
/** * Lists all Apis models that fit in a Category. * @param integer $categoryId * @return mixed */ public function actionIndexbycategory($categoryId) { $searchModel = new ApisSearch(); $queryParams = array_merge(['ApisSearch' => ['cbs' => 0, 'category' => $categoryId]], Yii::$app->request->getQueryParams()); $dataProvider = $searchModel->search($queryParams); $category = Categories::findOne($categoryId); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'category' => $category]); }