title: How to wrap HTML code without including new files in Twig?
body: <p>I have divs with CSS that represent boxes, they wrap html code.</p>
  
  <pre><code>&lt;div class="box indent"&gt;
    &lt;div class="padding"&gt;
      my code here
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I created a "layoutbundle" where every HTML wrapper (such as boxes, tabs, grids, and so on) is put inside separate twig files. In such a way, views on other bundles can be implemented with other layouts.</p>
  
  <p>But I get tired of includes. Every small html wrapper requires an include, and I wonder if there is a simpler way to wrap HTML code.</p>
  
  <p>Let's have an example with a simple box. Actually, I created several files :</p>
  
  <p>A <code>box.html.twig</code> file that contain the box and include the content :</p>
  
  <pre><code>&lt;div class="box indent"&gt;
    &lt;div class="padding"&gt;
      {% include content %}
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Several <em>box-content</em>.html.twig files, containing content of my boxes.</p>
  
  <p>And finally, I create a box in a view by doing :</p>
  
  <pre><code>{%
    include 'AcmeDemoBundle:layout:box.html.twig'
    with {
      'content': 'ReusableBundle:feature:xxx.html.twig'
    }
  %}
  </code></pre>
  
  <p>Is there a way to create wrappers such as :</p>
  
  <p>a) I declare once a new wrapper :</p>
  
  <pre><code>{% wrapperheader "box" %}
      &lt;div class="box indent"&gt;
        &lt;div class="padding"&gt;
  {% endwrapperheader %}
  
  {% wrapperfooter "box" %}
        &lt;/div&gt;
      &lt;/div&gt;
  {% endwrapperfooter %}
  </code></pre>
  
  <p>b) And then in my pages, I use :</p>
  
  <pre><code>{% wrapper "box" %}
    {# here my content #}
  {% endwrapper %}
  </code></pre>
  
  <p>I think I'll need to add new tag extensions in Twig, but first I want to know if something similar is natively possible.</p>