devel_wizard-2.x-dev/templates/devel_wizard.utils.twig
templates/devel_wizard.utils.twig
{% macro repeat(input, multiplier) -%}
{% autoescape false %}
{% if multiplier > 0 %}
{%- for i in range(1, multiplier) -%}
{{- input -}}
{%- endfor -%}
{% endif %}
{% endautoescape %}
{%- endmacro -%}
{%- macro indent_prefix(indent_text, indent_depth, prefix, lines ) -%}
{% autoescape false %}
{%- set lead = _self.repeat(indent_text, indent_depth) ~ prefix -%}
{%- for line in lines %}
{{ (lead ~ line)|trim(' ', 'right') ~ "\n" -}}
{%- endfor -%}
{% endautoescape %}
{%- endmacro %}
{%- macro typehint(types, is_nullable, prefix) -%}
{%- if types|length > 0 %}{{ prefix }}{% endif -%}
{%- if is_nullable %}?{% endif -%}
{{- types|join('|') -}}
{%- endmacro -%}
