Exemplo n.º 1
0
 public function actionPrice()
 {
     if (isset($_POST['p'])) {
         $modelPrice = new Price();
         $modelPrice->price = $_POST['p']['p_price'];
         $modelPrice->tax = $_POST['p']['p_tax'];
         $modelPrice->total = $_POST['p']['p_total'];
         $modelPrice->calculate();
         echo $modelPrice->getAjaxValue();
     } else {
         throw new Exception(Yii::t('error', 'Bad request'));
     }
 }