[ 'variables' => ['foo' => NULL], ], ]; } {% endif %} {% if create_preprocess %} /** * Prepares variables for {{ template_name }} template. * * Default template: {{ template_name }}.html.twig. * * @param array $variables * An associative array containing: * - foo: Foo variable description. */ function template_preprocess_{{ template_name|h2u }}(array &$variables) { $variables['foo'] = 'bar'; } {% endif %}