CodeIgniter表单验证匹配标签

Set*_*eth 1 php validation codeigniter

matches在CodeIgniter中运行表单验证时是否可以更改调用的输出?

我正在验证密码框验证密码.

array(
    'field' => 'userPassword',
    'label' => 'Password',
    'rules' => 'trim|required|matches[userConfPassword]'
)
Run Code Online (Sandbox Code Playgroud)

但是当错误被触发时,它打印出来:

The Password field does not match the userConfPassword field.
Run Code Online (Sandbox Code Playgroud)

用户不知道userConfPassword手段是什么,我想将其更改为更友好的东西.阅读文档我无法找到方法.

Dam*_*rsy 5

好吧,你可以覆盖默认消息:

$this->form_validation->set_message('matches', 'the two passwords do not match|');
Run Code Online (Sandbox Code Playgroud)

或者其他一些消息:).

我通常只使用该消息作为"确认密码",因此我根据需要设置了正常的密码字段,这是全部,而对于确认,我将其与输入的密码相匹配,而不是相反(或两者).但这只是我想的味道问题.

为了记录,它写在手册的一段中.