public function actionChangeCurrency() { $arrResult = []; $cur = Yii::$app->request->post('cur'); //vd($cur); $new_curency = Setup::changeCurrencyTo($cur); Yii::$app->response->format = Response::FORMAT_JSON; switch ($new_curency) { case 1: $new_curency = 'RUB'; break; case 2: $new_curency = 'DOLLAR'; break; case 3: $new_curency = 'UAN'; break; } $arrResult['new_currency'] = $new_curency . '<span class="caret"></span>'; return $arrResult; }