Skip to content

Instantly share code, notes, and snippets.

@johnsonch
Created February 9, 2015 14:42
Show Gist options
  • Save johnsonch/9e43ba64dac7b6c12db5 to your computer and use it in GitHub Desktop.
Save johnsonch/9e43ba64dac7b6c12db5 to your computer and use it in GitHub Desktop.
<html>
<head>
</head>
<body>
<?php
$error_messages = array();
array_push($errors, 'Some error');
array_push($errors, 'Another error');
array_push($errors, 'Wow this is bad');
?>
<h1>My great error list</h1>
<?php if (isset($errors) && count($errors) > 0) : ?>
<h3>There were errors that prevented the form from doing the thing</h3>
<ul class="errors">
<?php foreach($errors as $error) : ?>
<li><?= $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment