2014-05-06 66 views
0

這是什麼意思? 這是我的模型規則,還是這個錯誤與其他東西有關?屬性「CFileValidator.0」未定義yii

array('product_gallery_2, product_gallery_3, product_gallery_4, product_gallery_5, product_gallery_6', 'safe'=>true, 'file', 'allowEmpty' => TRUE,'types'=>'jpg, jpeg, png, gif', 'maxSize' => 600000, 'on'=>'insert,update,create'), 
array('product_image,product_gallery_1', 'file', 'safe'=>true,'types'=>'jpg, jpeg, png, gif', 'maxSize' => 600000, 'on'=>'insert,update,create'), 
array('product_image,product_gallery_1, product_gallery_2, product_gallery_3, product_gallery_4, product_gallery_5, product_gallery_6', 'length', 'max'=>50,'message'=>'{attribute} name is too long.'), 

回答

0

編輯:

safe(屬性,不驗證)應設置後您的規則,例如 '文件' 項:

array('product_gallery_2, product_gallery_3, product_gallery_4, product_gallery_5, product_gallery_6', 'file', 'safe'=>true, 'allowEmpty' => TRUE,'types'=>'jpg, jpeg, png, gif', 'maxSize' => 600000, 'on'=>'insert,update,create'), 
array('product_image,product_gallery_1', 'file', 'safe'=>true, 'types'=>'jpg, jpeg, png, gif', 'maxSize' => 600000, 'on'=>'insert,update,create'), 
+0

我在那之前就說過了'無法設置產品的不安全屬性「product_gallery_2」。「 – JamAndJammies

+0

回答更新。 – soju