public function actionIndex() { $this->layout = 'out_of_modal'; $modelNews = News::getlastNews(8); $modelItems = Items::getItemsByCatId(1); $modelCategiry = Category::find()->limit(4)->asArray()->all(); return $this->render('index', ['modelCategiry' => $modelCategiry, 'modelItems' => $modelItems, 'modelNews' => $modelNews]); }
public function actionGetItemsByCatId() { $id = Yii::$app->request->post('id'); $modelItems = Items::getItemsByCatId($id); //vd($model); Yii::$app->response->format = Response::FORMAT_JSON; return $this->renderAjax('_get-items-by-cat-id', ['modelItems' => $modelItems]); }