|
本帖最后由 cistage 于 2010-4-9 08:23 编辑
程序是这样的,按照手册上写的来的
$this->load->library('form_validation');
$this->form_validation->set_rules('name','Name','required|max_length[100]');
$this->form_validation->set_rules('password','Pass Word', 'required|max_length[20]|callback_getcheckPassword');
if ($this->form_validation->run()==FALSE)
{
$this->form_validation->set_message('required', 'Your custom message here');
$this->form_validation->set_message('getcheckPassword','Password error');
$this->load->vars($this->getData());
$this->load->view($this->getTemplate());
}
但是getcheckPassword错时 返回的信息是:
Unable to access an error message corresponding to your field name.
required错时 返回的信息是:
The Name field is required.
也就是说set_message更本没有任何作用啊
是codeigniter太差劲,还是我的代码有问题啊 |
|