public function actionAddcart($id) { $cart = new Cart(); $cart->addToCart($id); return $this->redirect(Yii::$app->request->referrer); }