$this->redirect() is not working

hi all

I run code:


show error:

Cannot modify header information - headers already sent by (output started




Stack trace:




however I comment //$this->redirect(’/admin/articles’);

It don’t show error


the error is self-explanatory: you cannot do redirect because some html data was already sent. Redirect is done using http headers and they can be sent only at the beginning of comunication (before any page data is sent). This is PHP way of handling http response headers.

in other ways - do not try to redirect after you called render() or renderPartial() which sends output. if you sure you do not call render/renderPartial - check if there is no "debug" echoes or BOM headers in your php files…

try this


 Yii::app()->controller->redirect(array('/myController/myAction', 'param1'=>'uno'));