Skip to content

Instantly share code, notes, and snippets.

@weaverryan
Created July 7, 2015 14:11
Show Gist options
  • Select an option

  • Save weaverryan/680d5aeddc406d906895 to your computer and use it in GitHub Desktop.

Select an option

Save weaverryan/680d5aeddc406d906895 to your computer and use it in GitHub Desktop.
Twig Modal
{#
sizeClass: modal-lg or modal-sm
#}
{% macro renderModal(id, title, body, footer, sizeClass) %}
<div class="modal fade" tabindex="-1" role="dialog" aria-hidden="true" id="{{ id }}">
<div class="modal-dialog {{ sizeClass|default }}">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">{{ title|raw }}</h4>
</div>
<div class="modal-body">
{{ body|raw }}
</div>
{% if footer %}
<div class="modal-footer">
{{ footer|raw }}
</div>
{% endif %}
</div>
</div>
</div>
{% endmacro %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment