Hi tôi đã cảnh báo chuỗi trong nhật ký khi chèn và cập nhật hành độngKhông thể thiết lập thuộc tính không an toàn
2013/02/05 16:43:57 [warning] [application] Failed to set unsafe attribute "logo" of "Model".
Quy định đối với mô hình
public function rules()
{
return array(
array('typeId, cityId, new', 'numerical', 'integerOnly'=>true),
array('title, url', 'length', 'max'=>255),
array('content, created, deleted', 'safe'),
array('url', 'url', 'on'=>'insert, update'),
array('typeId, cityId, title', 'required', 'on'=>'insert, update'),
array('logo', 'file', 'types'=>'jpg, jpeg, gif, png', 'maxSize'=>100*1024, 'allowEmpty'=>true, 'tooLarge'=>'{attribute} is too large to be uploaded. Maximum size is 100kB.'),
array('id, typeId, cityId, title, content, new, url, logo', 'safe', 'on'=>'search'),
);
}
Tôi không thể hiểu tại sao tôi nhận được worning này. Tôi có quy tắc cho lĩnh vực logo và có allowEmpty tùy chọn cho nó
Cảm ơn bạn !!!!!! – dr0zd