/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreate() { $model = new PaymentDetails(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['PaymentDetails'])) { $model->attributes = $_POST['PaymentDetails']; if ($model->save()) { $this->redirect(array('view', 'id' => $model->id)); } } $this->render('create', array('model' => $model)); }
/** * This is the default 'index' action that is invoked * when an action is not explicitly requested by users. */ public function actionIndex() { // renders the view file 'protected/views/site/index.php' // using the default layout 'protected/views/layouts/main.php' $model = new PaymentDetails(); $modelPay = new PaymentInterswitch(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['PaymentDetails'])) { $model->attributes = $_POST['PaymentDetails']; if ($model->save()) { $modelPay->save(); } $this->redirect(array('index')); } $this->render('index', array('model' => $model, 'modelPay' => $modelPay)); //$this->render('index'); //echo Yii::app()->session['transaction_id']; }