Yii Framework Forum: Form attributes rules - Yii Framework Forum

Jump to content

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

Form attributes rules Rate Topic: -----

#1 User is offline   jbomhold3 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 20
  • Joined: 06-May 10

Posted 08 May 2010 - 08:32 PM

Are you required to have a rule of each attribute for data to be collected? If I don't have a rule on a attribute it will not collect data. I'm wondering if this is normal?
0

#2 User is offline   tri 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,651
  • Joined: 20-November 08
  • Location:Stockholm, Sweden

Posted 08 May 2010 - 08:58 PM

View Postjbomhold3, on 08 May 2010 - 08:32 PM, said:

Are you required to have a rule of each attribute for data to be collected? If I don't have a rule on a attribute it will not collect data. I'm wondering if this is normal?


You can use the 'safe' validator for attributes with no other rule.

Read more here (Safe Attributes in 1.1)
http://www.yiiframew...uide/form.model

/Tommy
Don't forget to read The Definitive Guide to Yii (en) (sv) | The class reference has the details
0

#3 User is offline   jbomhold3 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 20
  • Joined: 06-May 10

Posted 08 May 2010 - 08:59 PM

Ok ty mostly related question. Why are input fields with default values returning can not be blank errors.

--- Edit never mind code error on my side
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