验证规则设置如下,用于codeigniter 3中的文件验证
$this->form_validation->set_rules('CollegeLogo', 'college logo', 'callback_image_upload');
image_upload函数
public function image_upload()
{
if($_FILES['CollegeLogo']['size'] == 0)
{
$this->form_validation->set_message('image_upload', "No file selected");
return false;
}
}
但在代码运行后给出错误消息:无法访问与您的字段名称大学徽标相对应的错误消息。(image_upload)
或任何其他解决方案?