This thing is really driving me crazy. I am working on a project from 6 months, Everythign working fine but now Flash message not display after Rediction. It is working fine on localhost. But when i deploy it on server, i don’t what happened to it and it does not show flash message.
Controller
public function actionCreateInventoryItem()
{
$errors = '';
$model=new Imei('inventory_imei');
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if(isset($_POST['Imei']))
{
$model->attributes = $_POST['Imei'];
//saving data to imei and imei history
if($model->save()){
yii::app()->user->setFlash('success', 'Item created successfully');
$this->redirect('createinventoryitem', array( 'id'=> $id ));
}
else{
foreach ($model->getErrors() as $error){
$errors .= $error[0]."<br>";
}
yii::app()->user->setFlash('error', $errors);
}
}
$this->renderPartial('popup_inv_item',array(
'model'=>$model,
),false, true);
}
when $trminate !== true code continues to evaluate and renderPartial is called which consumes flashes. You wont see them because content of response having redirect (header Location: XXX) is ignored and discarded. You could however see it in FireBug, which I strongly recommend as HTTP debugger before posting on forum…