I have a Chtml::link like this:
echo CHtml::link('DESACTIVAR',array ('/ZfIncidencias/estado', 'id'=>$data->incidencia_id),array("class"=>"desactivar"));
This execute the action, but what I need is this:
$id_on = $data->incidencia_id;
$content_on = '<div class="onoffswitch">
<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="'.$id_on.'" checked />
<label class="onoffswitch-label" for="'.$id_on.'">
<div class="onoffswitch-inner"></div>
<div class="onoffswitch-switch"></div>
</label>
</div> ';
echo CHtml::link($content_on,array('/ZfIncidencias/estado', 'id'=>$data->incidencia_id));
And when I click the action is not executed.
There is a way to force it to execute?
SOLUTION:
$id_off = $data->incidencia_id;?>
<div class="onoffswitch">
<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="<?php echo $id_off;?>" unchecked onClick="javascript:location.href = '<?php echo Yii::app()->baseUrl.'/ZfIncidencias/estado/'.$data->incidencia_id;?>'"; />
<label class="onoffswitch-label" for="<?php echo $id_off;?>">
<div class="onoffswitch-inner"></div>
<div class="onoffswitch-switch"></div>
</label>
</div>