Yii Framework Forum: Custom ''allowempty' => False Error Message ? - Yii Framework Forum

Jump to content

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

Custom ''allowempty' => False Error Message ? Rate Topic: -----

#1 User is offline   Ziggi 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 161
  • Joined: 14-August 12

Posted 20 January 2013 - 10:03 AM

Hi,

Presuming 'allowEmpty' => FALSE rule failed to validate for given attribute the following error message is generated by default:

{attribute} cannot be blank.

Well, any idea how to customise this error message?

Thanks ahead!
0

#2 User is offline   Scotty G 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 23-May 13

Posted 12 February 2016 - 03:09 PM

I know this is old but I figured out the answer so I thought I would share ...

'allowEmpty'=>false, 'message'=>'custom message here' //overrides the default ...cannot be blank
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