I am using a try-catch block for an sql query. I would like to have a popup showing the error message cauth. After closing the popup, the program should run further reulting in a redirect.
}catch(Exception $ex){
"code for popup?"
}
$this->redirect(array('workflow','id'=>$model->del_oid));
I tried using CJuiDialog, but it doesnt stops the program, so the code redirects and i cant even see the error window. I tried using javascript alert, but in this case, the header is sent before the redirect and i get "Cannot modify header information - headers already sent by" error.
What is the proper way to do this? Any suggestions?
Actually with the CJuiDialog i get the same header error. So i guess my question is, how to display a popup, and after closing it, how to redirect without cousing a header error?