Last active
December 16, 2015 03:49
-
-
Save Tom32i/5372792 to your computer and use it in GitHub Desktop.
Twig: Utiliser le tag embed.
This file contains 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
{# template.html.twig #} | |
<h1>Mon grand titre </h1> | |
{% embed "user.html.twig" %} | |
{% block titre %} | |
<h2>Mon titre</h2> | |
{% endblock %} | |
{% block bottom %} | |
{{ parent () }} | |
<a href="#" title="Mon autre lien">Mon autre lien</a> | |
{% endblock %} | |
{% endembed %} |
This file contains 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
{# user.html.twig #} | |
<div class="user"> | |
{% block titre %} | |
<h1>Mon titre</h1> | |
{% endblock %} | |
{% block content %} | |
<p>Mon contenu</p> | |
{% endblock %} | |
{% block bottom %} | |
<a href="#" title="Mon lien">Mon lien</a> | |
{% endblock %} | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment