danteODST
(Danteodst)
1
I am looking for a correct syntax to disable a CHtml link when the value is "1" in clistview.
This is my code. I tried some arrays, but always got error. I do not know the correct syntax to make it work.
<?php echo CHtml::link($data->EstadoDetalle==1?'Entregada':'No entregada', array('estado', 'id'=>$data->CodigoDetalleReceta)); ?>
softark
(Softark)
2
Does CHtml::link support "disabled" status?
Why don’t you do it simple like this?
<?php
if ($data->EstadoDetalle == 1) {
echo CHtml::link('Entregada' array('estado', 'id'=>$data->CodigoDetalleReceta));
} else {
echo 'No entregada';
}
?>
danteODST
(Danteodst)
3
I am new to yii and php and i was having error with the sintax, still need a lot to learn these are the 2 codes that i used:
For totally hide the link:
if($data->EstadoDetalle != 1){
echo CHtml::link('Entregada', array('estado', 'id'=>$data->CodigoDetalleReceta));
}
And this one:
echo CHtml::link(
'Link Title',
($data->CodigoDetalleReceta == 1) ? array('estado', 'id'=>$data->CodigoDetalleReceta) : 'javascript:void(0);'
);