qwe*_*tty 1 php yii cactiverecord yii-validation
我对CActiveRecord.rules有疑问
public function rules(){
return array(
array('photo_path', 'required', 'on'=>'insert'),
array('photo_path', 'file', 'types'=>'jpg, gif, png', 'allowEmpty'=>true),
);
}
只有在创建模型时才需要Photo_path,在更新视图中它可以为空.
我不知道发生了什么,但一小时前它有效,但现在却没有.当我选择文件时,我得到'照片路径不能为空'
请帮忙 :)