Yii Framework Forum: Cactiveform Label Vs Labelex - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Cactiveform Label Vs Labelex Rate Topic: -----

#1 User is offline   Trinh Duy Hung 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 73
  • Joined: 26-October 12

Posted 28 November 2012 - 11:40 PM

Hello everyone!

I can't figure out what is CActiveForm->label() differs from CActiveForm->labelEx().

Could someone tell me the differences?

Thanks in advanced!

Hung
0

#2 User is offline   LastDay 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 62
  • Joined: 06-March 11
  • Location:Russia

Posted 29 November 2012 - 08:22 AM

Hello,

In two words - labelEx adds '*' and special css class right to your label if attribute is required.


From http://www.yiiframew...LabelEx-detail:

Quote

"It will render additional CSS class and mark when the attribute is required. In particular, it calls CModel::isAttributeRequired to determine if the attribute is required. If so, it will add a CSS class CHtml::requiredCss to the label, and decorate the label with CHtml::beforeRequiredLabel and CHtml::afterRequiredLabel."

0

#3 User is offline   Trinh Duy Hung 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 73
  • Joined: 26-October 12

Posted 05 December 2012 - 01:48 AM

View PostLastDay, on 29 November 2012 - 08:22 AM, said:

Hello,

In two words - labelEx adds '*' and special css class right to your label if attribute is required.


From http://www.yiiframew...LabelEx-detail:

Thank you. I got it now.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users