0
這是什麼怪事,當set_rules被告知尋找current_password
它不會工作,當它被告知尋找current-password
它。set_rules()不合作
<input type="password" name="current_password" id="current_password" value=""/>
請注意,name和id都有下劃線。
$this->form_validation->set_rules('current_password', 'Password', 'required|callback_check_password['.$user_id.']');
//This gives me
Unable to access an error message corresponding to your field name.
以上規則不會工作,但如果我改變它太set_rules('current-password'
它開始顯示錯誤消息。
與<?php echo validation_errors(); ?>
做後期的轉儲印刷錯誤信息顯示array(1) { ["current_password"]=> string(4) "test" }
我不知道,如果回調格式不錯,我認爲它應該是'callback_check_password'而不是'callback_check_password ['。$ user_id。']' – manix
我正在傳遞另一個參數,它是允許的。 – Bankzilla
如何在回調函數中設置字段消息? – manix