第二个问题,设置 $this->form_validation->set_message('max_length', '啊哈...这儿不能超出 %s 个字符');
注意看手册
原文:
Where rule corresponds to the name of a particular rule, and Error Message is the text you would like displayed.
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.
额,我还没翻译完,等剃头了回来把这一篇翻译一下 1 用helper即可。文件结尾不加?>是为了方式意外在后面放置空行,改变输出。这是一个好的php编程实践。
2 试试设置类似这样的参数代入形式的消息:"The %s field can not exceed %s characters in length." 不错~~~~~~ 本帖最后由 qi_ruo 于 2010-10-11 01:22 编辑
是这样滴:) 我的解决办法也是使用自定义的config,这应该是最好的一种方法了。在autoload里再把你的自定义config加载进去,就不用你每一个控制器里都去load一次了。 多啊 直接写在helper函数里,用的时候$this->helper('XXX');把处理后的结果返回就行了,。。
页:
1
[2]