public function actionCreamaterial() { $model = new Maestroclipro(); // Uncomment the following line if AJAX validation is needed //$this->performAjaxValidation($model); if (isset($_POST['Maestroclipro'])) { $model->attributes = $_POST['Maestroclipro']; if ($model->validate()) { $model->save(); if (!empty($_GET['asDialog'])) { //Close the dialog, reset the iframe and update the grid echo CHtml::script("window.parent.\$('#cru-dialog4').dialog('close');window.parent.\$('#cru-frame4').attr('src','');window.parent.\$.fn.yiiGridView.update('{$_GET['gridId']}');"); Yii::app()->end(); } } } if (!empty($_GET['asDialog'])) { $this->layout = '//layouts/iframe'; } $this->render('_form_materiales', array('model' => $model, 'codpro' => $_GET['codpro'])); }