Codeigniter表单验证 - 是否有一种方法来定义多个不同的%s设置错误消息? [英] Codeigniter Form Validation - Is there a way to define multiple different %s when setting error messages?

查看:111
本文介绍了Codeigniter表单验证 - 是否有一种方法来定义多个不同的%s设置错误消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据文档,%s将被字段名称替换

Based on the documentation, %s will be replaced by field name when setting error messages.


如果在错误字符串中包含%s,它将替换为
human

If you include %s in your error string, it will be replaced with the "human" name you used for your field when you set your rules.

有一种方法可以在字符串中包含多个%s,并以不同的方式定义它们?

Is there a way to have multiple %s in the string and define them differently?

推荐答案

这是表单验证库中创建错误消息的行:

This is the line in the form validation library that creates the error message:

// Build the error message
$message = sprintf($line, $this->_translate_fieldname($row['label']), $param);



查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆