Поддержка аттрибутов в макросе b
parent
61ad931508
commit
217c11ad22
|
@ -1,8 +1,5 @@
|
||||||
{% macro b(class=None, tag="div", id=None) -%}
|
{% macro b(tag="div", attributes=None) -%}
|
||||||
<{{ tag }}
|
<{{ tag }}{% if attributes %} {{attributes|safe}}{%endif%}{% for name, value in kwargs.items() %} {{name}}="{{value}}"{% endfor -%}>
|
||||||
{%- if class is not none %} class="{{class}}" {%- endif -%}
|
|
||||||
{%- if id is not none %} id="{{id}}" {%- endif -%}
|
|
||||||
>
|
|
||||||
{%- if caller %}
|
{%- if caller %}
|
||||||
{{ caller() }}
|
{{ caller() }}
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
|
|
Reference in New Issue