fabpot/Twig — pull request #661 by nicodmf (2012-03-11 20:06:08+00:00)
Title: Integrate a virtual block and add an optionnal on block

Ref to the [yesterday feature request](https://github.com/fabpot/Twig/issues/659#issuecomment-4434672).

As i have this afternoon free after watching the code this night. I have made many tests and few littles changes. I searched to preserve inheritence, and i think to have find solutions.

So just if you interest, you can see my sunday coding party :). If you want more, but as i understand, i'm not sure that's the case, i can write tests and better code, in another clearly pr.

**Technicals notes :**
I made renders test and run phpunit.

* on **phpunit : 7 failures**. the principals errors are on the redefinition of the compiled template and on the breaks on the body in extending template.
* on my personnals tests, the only problem not resolved is the obligation to not integrate the special block in a extending template and use the block function instead it.

The option on block permit to define a block without display it where is defined.

I know that all the tab aren't corrected...

**If somebody want code to test** :

```html+jinja
{# index.html#}
{%extends "layout3.html.twig"%}
index
{% block content false %}
Hello {{ name }}!
{% endblock %}
index

{# layout3.html.twig#}
{%extends "layout2.html.twig"%}
layout3 {{block("child_content")}}
{% block left false%}
left
{%endblock %}

{# layout2.html.twig#}
{%extends "layout.html.twig"%}
layout2 {{block("child_content") }}

{# layout.html.twig#}
layout

Child content:{{block("child_content")}}

Content: {{block("content")}}

```