i've got problem using redirect at the end of a controller.
In a view, i want to use an action closed to delete, called with a link:
<?php $this->widget('zii.widgets.grid.CGridView', array(
'dataProvider'=>$dataProvider,
...
array(
'class'=>'CButtonColumn',
'template' => '{detaches}{notes}',
'buttons' => array(
'detaches' => array(
'label'=>'Detaches',
'imageUrl'=>'',
'imageUrl'=>Yii::app()->request->baseUrl.'/images/detaches.ico',
'url'=>'Yii::app()->createUrl("/RelStudentSemester/detache", array("id"=>$data->primaryKey,"rattrapage"=>$data->group->rattrapage_ind, "group_id"=>$data->group_id))',
),
...
This is my action code:
/**
* Détache un étudiant d'un groupe
* @param integer $id ID du RelStudentSemester à modifier
* @param text $rattrapage indique si on est sur un groupe de semester ou de rattrapage
* @param integer $group_id indique le groupe à réafficher à la fin du traitement
* * */
public function actionDetache($id, $rattrapage, $group_id)
{
$rel=RelStudentSemester::model()->findByPk($id);
if($rattrapage == '1') // on est sur un groupe de rattrapage
{
$rel->group_rattrapage = 0;
$rel->save();
}
else // groupe de semestre
{
$rel->group_id = 0;
$rel->save();
}
$this->redirect(array('/groups/view', array("id"=>$group_id)));
} // fin actionDetache
But the redirect didn't work:
Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/GL1/protected/controllers/RelStudentSemesterController.php:6)
I've check the output on line 6 of my controller, it's just the begin of the file (it contains "<?php").
Can someone help me?

Help















