Skip to content

Commit

Permalink
[#2375] Update documentation for attributes macro
Browse files Browse the repository at this point in the history
  • Loading branch information
aron committed Jul 18, 2012
1 parent b7ebc40 commit 23b2e77
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ckan/templates/macros/form.html
Expand Up @@ -245,6 +245,18 @@
{% endif %}
{% endmacro %}

{#
Builds a space seperated list of html attributes from a dict of key/value pairs.
Generally only used internally by macros.

attrs - A dict of attribute/value pairs

Example

{% import 'macros/form.html' as form %}
{{ form.attributes({}) }}

#}
{%- macro attributes(attrs={}) -%}
{%- for key, value in attrs.items() -%}
{{ key }}="{{ value }}"
Expand Down

0 comments on commit 23b2e77

Please sign in to comment.