The following is the Cdetailview display page for Yiichina's official profile:
Notice the right side, and if the value is empty, the display is not set. And it's pink.
This is the effect I wrote myself:
The main difference is the display of the value on the right. The official website right side of the value is not the time to show pink, and I here is directly blank.
I looked at the API and found that there was a cssclass this attribute. So I tried to write:
array( 'label'=>'关注', 'type'=>'raw', 'cssClass'=>'null', 'value'=>CHtml::link(CHtml::encode('查看我关注的人'), array('relations/followList')), ),
It turns out that the label tag is getting pink, not the value being pink.
How can I write to make the value on the right turn pink, and not set when the values are empty, instead of being a blank as I write?
Reply content:
The following is the Cdetailview display page for Yiichina's official profile:
Notice the right side, and if the value is empty, the display is not set. And it's pink.
This is the effect I wrote myself:
The main difference is the display of the value on the right. The official website right side of the value is not the time to show pink, and I here is directly blank.
I looked at the API and found that there was a cssclass this attribute. So I tried to write:
array( 'label'=>'关注', 'type'=>'raw', 'cssClass'=>'null', 'value'=>CHtml::link(CHtml::encode('查看我关注的人'), array('relations/followList')), ),
It turns out that the label tag is getting pink, not the value being pink.
How can I write to make the value on the right turn pink, and not set when the values are empty, instead of being a blank as I write?
$this->widget('zii.widgets.CDetailView', array( 'data'=>$model, 'attributes'=>array( 'id', 'name', 'description', 'directory', 'weight', 'created', 'modified', //xxx不存在于model里边的属性时,会变红 'xxx',
The value is judged in view. When the value is empty, the output is not set and a class with a pink effect is added to the label.