Last active
January 2, 2016 16:29
-
-
Save ianjosephwilson/8330653 to your computer and use it in GitHub Desktop.
broken form helpers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% macro form_error(key, errors) -%}{%- endmacro %} | |
{% macro form_input(key, values, errors=None, label=None, type='text') %} | |
<div class="form-group{{' error' if errors and key in errors else ''}}"> | |
<label class="form-label">{{ label or key.replace('_', ' ').title() }}</label> | |
<input type="{{ type }}" name="{{ key }}" | |
value="{{ values.get(key, '') }}" | |
class="form-control"> | |
{% form_error(key, errors) %} | |
</div> | |
{% endmacro %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment