public function actionDetail() { $data = $this->getCommonDate(); $modelBest = Goods::getBest(3); $iP = Yii::$app->session->id; $quantityInCart = Cart::getQountAllByIp($iP); $id = Yii::$app->request->get('item'); $modelReview = Review::getReviewsByGoodId($id); $modelGoodsCategories = GoodsCategory::find()->all(); $modelBrends = Brend::find()->all(); if (!$id) { $this->redirect('/shop/index'); } $model = Goods::getItemById($id); $modelPhotos = GoodsPhotos::getItemsByGoodId($id); $_modelReview = new Review(); return $this->render('detail', ['modelPhotos' => $modelPhotos, 'data' => $data, 'model' => $model, 'modelGoodsCategories' => $modelGoodsCategories, 'modelReview' => $modelReview, '_modelReview' => $_modelReview, 'modelBest' => $modelBest, 'modelBrends' => $modelBrends]); }