【发布时间】:2018-06-18 14:55:55
【问题描述】:
有设置消息的回调函数,
public function username_check($str)
{
if ($str == 'test')
{
$this->form_validation->set_message('username_check', 'The {field} field can not be the word "test"');
return FALSE;
}
else
{
return TRUE;
}
}
在输出中,{field} 被“输入键”的名称替换。谁能告诉我如何将此 {field} 标记值存储在变量中,因为我不想在我的业务逻辑中使用它。
【问题讨论】:
-
您可以在
form_validation_lang.php中添加该行,例如$lang['input_1'] = 'name_you_want';,然后您可以像$this->lang->line('language_key');一样使用它
标签: codeigniter