Skip to content

Instantly share code, notes, and snippets.

@COil
Last active December 14, 2015 01:09
Show Gist options
  • Save COil/5004477 to your computer and use it in GitHub Desktop.
Save COil/5004477 to your computer and use it in GitHub Desktop.
Twig C extension benchmark 2/2
<li>
{% if field.is_selected is defined %}
<input type="checkbox" value="1"{{ html_checked(selected) }} name="{{ name }}" id="{{ id }}" class="{{ class }}">
<label for="{{ id }}">{{ field.element }}</label>
{% endif %}
{% if field.choices is defined %}
<ul>
{% for rankLevel2, subField in field.choices %}
{% include 'ThemesBundle:Search:_group_tree.html.twig' with {
'form': form,
'widget': widget,
'rankLevel1': rankLevel1,
'rankLevel2': rankLevel2,
'field': subField,
'parentSelected': field.is_selected,
'level': level + 1
} %}
{% endfor %}
</ul>
{% endif %}
</li>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment