当我尝试更新用户记录时,我得到了这个错误"调用未定义的方法CI_Form_validation::substr(("。就我所调查的电子邮件的表单验证返回错误而言。
if($this->input->post('stu_emailid')){
$this->form_validation->set_rules('stu_emailid', 'Email', 'trim|required|valid_email|edit_unique[users.user_email.user_id.' . $student_user_id . ']|edit_unique[student.stu_emailid.student_id.' . $user_id . ']',
array(
'required' => 'You have not provided %s.',
'is_unique' => 'This %s already exists.'
));
}
edit_unique
不是CI表单验证的规则,它应该是is_unique
if($this->input->post('stu_emailid')){
$this->form_validation->set_rules('stu_emailid', 'Email', 'trim|required|valid_email|is_unique[users.user_email.user_id.' . $student_user_id . ']|is_unique[student.stu_emailid.student_id.' . $user_id . ']',
array(
'required' => 'You have not provided %s.',
'is_unique' => 'This %s already exists.'
));