Yii Framework Forum: Cnumbervalidator Error When The Attribute Is A Cdbexpresision Object - Yii Framework Forum

Jump to content

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

Cnumbervalidator Error When The Attribute Is A Cdbexpresision Object Rate Topic: -----

#1 User is offline   EricLei 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 29-July 10

Posted 28 November 2012 - 01:45 AM

When use the CNumberValidator, if the attribute is a CDbExpression, for example "new CDbExpression($attr + 1)", the validator will throw a exception
0

#2 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,346
  • Joined: 12-October 09
  • Location:Croatia

Posted 28 November 2012 - 04:45 AM

This problem is related to your logic... why would you validate a CDbExpression... Yii validator cannot know the value that will be given only at the database level at the time the record is added.
Find more about me.... btw. Do you know your WAN IP?
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