codeIgniter 中是否有一个文件,我可以在其中进行编辑,以便自定义表单验证消息?
我只是想将它们放在项目符号列表中以消耗更少的空间。
这是我用来输出错误消息的代码:
<div class="alert <?php echo $alert['alert_type']; ?> min-form">
<button type="button" class="close" data-dismiss="alert">x</button>
<h4><?php echo $alert['main_message']; ?></h4>
<?php echo $alert['sub_message']; ?>
</div>
基本上是$alert['sub_message']
只是从获取数据validation_errors()
CodeIgniter 中的函数,它从表单输出验证错误。
您可以更改错误分隔符这样:
<ul>
<?php echo validation_errors('<li>', '</li>'); ?>
</ul>
docs: https://www.codeigniter.com/user_guide/libraries/form_validation.html#chang-the-error-delimiters
For v3: https://www.codeigniter.com/userguide3/libraries/form_validation.html#chang-the-error-delimiters
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)