Skip to content

Instantly share code, notes, and snippets.

@coreymcmahon
Created May 7, 2012 13:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coreymcmahon/2627750 to your computer and use it in GitHub Desktop.
Save coreymcmahon/2627750 to your computer and use it in GitHub Desktop.
The view code for displaying a list of users - http://www.symfonycentral.com/symfony-does-validation.html
<h1>Users</h1>
{% if users|length == 0 %}
{# No users to display... #}
<p>Could not find any users :(</p>
{% else %}
<table>
<thead>
<td>Username</td>
<td>Email address</td>
<td>Password</td>
</thead>
{% for user in users %}
<tr>
<td>{{ user.username }}</td>
<td>{{ user.email }}</td>
{# Of course we'd never show passwords in plain-text #}
<td>********</td>
</tr>
{% endfor %}
</table>
{% endif %}
<button onclick="window.location = '{{ path('user_create') }}'; return false;">Add some!</button>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment