public function do_update_admin()
{
//调用验证规则
$this->form_validation->set_rules('admin_user','* 原始密码','callback_username_check');
$this->form_validation->set_rules('newpass','* 新密码','required');
$this->form_validation->set_rules('renewpass','* 确认密码','required|matches[newpass]');
//表单验证
if($this->form_validation->run() == FALSE)
{
$this->load->view('admin/pass.html');
}
}
public function username_check($str)
{
if ($str == 'test')
{
$this->form_validation->set_message('原始密码', '原始密码不对!');
return FALSE;
}
else
{
return TRUE;
}
}