Updating Array Variable In Extending Template
You can only access the parent's variable, not modify it. You could however simply add another block specifically for the body class, like so:

Layout template:

&lt;body class="{% block body_class %}default-class-1 default-class-2{% endblock %}"&gt;
    {{ block('pageBody') }}
&lt;/body&gt;


Template that extends it:

{% extends 'layout' %}

{% block body_class %}{{ parent() }} myclass{% endblock %}

{% block pageBody %}
    &lt;h1&gt;Hello World&lt;/h1&gt;
    &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab, consequuntur!&lt;/p&gt;
{% endblock %}


Note the call to parent() that includes the default classes defined in the parent template.