Created
August 12, 2014 16:16
-
-
Save ubermuda/305f9cc71b80931eee65 to your computer and use it in GitHub Desktop.
I was looking for a way to do this, turns out twig has exactly this feature! http://twig.sensiolabs.org/doc/tags/embed.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# hypothetic twig tag "with" #} | |
{% with 'panel.html.twig' %} | |
{% block panel_title %}This is the panel title{% endblock %} | |
{% block panel_body%} | |
<p>This is the panel body</p> | |
{% endblock %} | |
{% endwith %} | |
{% with 'panel.html.twig' %} | |
{% block panel_title %}This is another panel title{% endblock %} | |
{% block panel_body%} | |
<p>And the body</p> | |
{% endblock %} | |
{% endwith %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="panel panel-default"> | |
<div class="panel-heading"> | |
<h3 class="panel-title">{% block panel_title %}{% endblock %}</h3> | |
</div> | |
<div class="panel-body"> | |
{% block panel_body %}{% endblock %} | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment