我想要这样它会记录错误,它可以工作但是我
<?php
if(!empty($err)) {
echo "<div class=\"msg\">";
foreach ($err as $e) {
echo "* $e <br>";
}
echo "</div>";
}
?>
我想将此添加到
<div class="alert alert-app-level alert-danger">
<div class="alert-item">
<div class="alert-text">
LOGIN ERROR TEXT HERE
</div>
</div>
</div>
答案 0 :(得分:0)
试试这个,
{{link-to}}
答案 1 :(得分:0)
在html中嵌入php并将每条错误消息封装在div
标记中,以便进一步进行CSS自定义(不再需要<br>
):
<div class="alert alert-app-level alert-danger">
<div class="alert-item">
<div class="alert-text">
<?php
if (!empty($err)) {
?>
<div class="msg">
<?php
foreach ($err as $e) {
?>
<div class="error">* <?php echo $e; ?></div>
<?php
}
?>
</div>
<?php
}
?>
</div>
</div>
</div>