0
我已閱讀文檔,但此表單仍顯示默認消息?CodeIgniter自定義錯誤消息不起作用?
據我所知,我設置了一個規則,然後將消息應用於該規則?
https://ellislab.com/codeigniter/user-guide/libraries/form_validation.html
$this->load->library('form_validation');
$this->form_validation->set_error_delimiters('<p class="text-danger"><i class="fa fa-exclamation-triangle"></i> ', '</p>'); //Controls what element the error is put in, <p> by default.//
$this->form_validation->set_rules('Username', 'Username', 'trim|required');
$this->form_validation->set_message('Username', 'username required');
$this->form_validation->set_rules('Password', 'Password', 'trim|required|callback_CheckDatabase');
$this->form_validation->set_message('Password', 'password required');