onikandish
(Onikandish)
1
hi
i want to put an optional logo picture(by upload an image) for my company registering form.
my validation rule is:
array('logo', 'file', 'types'=>'jpg, jpeg, png', 'maxSize' => 20480, 'on'=>'create'),
but it is not optional. how can i set this optional?
yan
(Yaroslav)
2
http://www.yiiframework.com/doc/api/1.1/CFileValidator#allowEmpty-detail ?
onikandish
(Onikandish)
3
thanks, i looked the Class Reference previously but wonderfully i don’t see this property.
Ankit_Modi
(Ankit Modi)
4
try this
array('image_name', 'file', 'allowEmpty' => TRUE,'types' => 'jpg, jpeg, gif, png','on'=>'create'),