How did the DetailView of the Yiichina official website personal data come out?

Source: Internet
Author: User

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.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.