Esempio n. 1
0
 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]);
 }
Esempio n. 2
0
 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]);
 }