<p dir="auto">I pass a global variable "foo" to Twig.  Here's the config.yaml</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="twig:
    globals:
        foo: &quot;@acme.foo.foolistener&quot;"><pre class="notranslate"><code class="notranslate">twig:
    globals:
        foo: "@acme.foo.foolistener"
</code></pre></div>
<p dir="auto">This works fine.  But when I add a self themed form block (see below) to the template, the foo variable is destroyed.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{% form_theme form _self %}

{% block integer_widget %}
    &lt;div class=&quot;integer_widget&quot;&gt;
        {% set type = type|default('number') %}
        {{ block('field_widget') }}
    &lt;/div&gt;
{% endblock %} "><pre class="notranslate"><code class="notranslate">{% form_theme form _self %}

{% block integer_widget %}
    &lt;div class="integer_widget"&gt;
        {% set type = type|default('number') %}
        {{ block('field_widget') }}
    &lt;/div&gt;
{% endblock %} 
</code></pre></div>
<p dir="auto">With symfony 2.0.9 this code :</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{% form_theme form _self %}

{% block field_label %}
{{ app.session.locale }}
{% endblock %}

{% block container %}
    {{ form_widget(form) }}
{% endblock %}"><pre class="notranslate"><code class="notranslate">{% form_theme form _self %}

{% block field_label %}
{{ app.session.locale }}
{% endblock %}

{% block container %}
    {{ form_widget(form) }}
{% endblock %}
</code></pre></div>
<p dir="auto">generate an error :</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Variable &quot;app&quot; does not exist in myBundle:Entity:view.html.twig at line 7
500 Internal Server Error - Twig_Error_Runtime "><pre class="notranslate"><code class="notranslate">Variable "app" does not exist in myBundle:Entity:view.html.twig at line 7
500 Internal Server Error - Twig_Error_Runtime 
</code></pre></div>