zipzapduo
(Zipzapduo)
July 22, 2012, 11:55am
1
$this->widget('zii.widgets.CDetailView', array(
'data'=>$ritmo,
'attributes'=>array(
'artist',
'title',
array(
'label'=>'price',
'value'=>$ritmo->price.' €')));
How to display the ritmo column with a condition if??
bit0123
(Kaushik Itdu)
July 22, 2012, 2:12pm
2
$this->widget('zii.widgets.CDetailView', array(
'data'=>$ritmo,
'attributes'=>array(
'artist',
'title',
array(
'label'=>'price',
'value'=>$ritmo->price.' €')));
How to display the ritmo column with a condition if??
Hello
You can use
'visible'=>'condition',//$data->active==1
I think this can help…
Bianca
(Biancajsen)
July 22, 2012, 7:02pm
3
$this->widget('zii.widgets.CDetailView', array(
'data'=>$ritmo,
'attributes'=>array(
'artist',
'title',
array(
'label'=>'price',
'value'=>$ritmo->price.' €')));
How to display the ritmo column with a condition if??
Try this for example if the condition is to check if the price is equal to 200:
'value'=>$ritmo->price==200?'to be displayed if true':'to be displayed if false'
steved
(Steved23)
January 16, 2013, 7:04pm
5
Another useful technique is to make column visibility conditional based on the current user’s security settings. Here’s a simple example that works with role based access:
...
'attributes' => array(
'Column1Name',
'Column2Name',
array(
'name'=>'Column3Name',
'visible'=>Yii::app()->user->checkAccess('RoleOrTaskOrUserName'),
),
...