Symfony Form component and Twig

Code
<?php

use Symfony\Bridge\Twig\Form\TwigRendererEngine;
use 
Symfony\Component\Form\Forms;
use 
Symfony\Bridge\Twig\Extension\FormExtension;
use 
Symfony\Bridge\Twig\Form\TwigRenderer;
use 
Symfony\Component\Form\Extension\Core\Type\TextType;
use 
Symfony\Component\Form\Extension\Core\Type\SubmitType;

$formLayout = <<<'NOW'
{%- block text_widget -%}
    <label for="{{ id }}">{{ label }}</label>
    <input type="text" id="{{ id }}" name="{{ name }}"/>
{%- endblock text_widget -%}

{%- block submit_widget -%}
    <input type="submit" id="{{ id }}" value="{{ label }}"/>
{%- endblock submit_widget -%}

{%- block form -%}
    <form name="{{ name }}" method="post">
        {% for child in form %}
            {{- form_widget(child) -}}
        {% endfor %}
    </form>
{%- endblock form -%}
NOW;

$templates = [
    
'form_layout' => $formLayout,
    
'form' => '{{ form(form) }}',
];
$loader = new Twig_Loader_Array($templates);
$twig = new Twig_Environment($loader);

$formEngine = new TwigRendererEngine(['form_layout']);
$formEngine->setEnvironment($twig);
$twigRenderer = new TwigRenderer($formEngine);

$twig->addExtension(new FormExtension($twigRenderer));
$runtimeLoader = new class($twigRenderer) implements Twig_RuntimeLoaderInterface {
    
    private 
$renderer;
    
    public function 
__construct(TwigRenderer $renderer)
    {
        
$this->renderer $renderer;
    }
    
    public function 
load($class)
    {
        return 
$this->renderer;
    }
};
$twig->addRuntimeLoader($runtimeLoader);

$form Forms::createFormFactory()
    ->
createBuilder()
    ->
add('my_text'TextType::class, [
        
'label' => 'My text',
    ])
    ->
add('my_other_text'TextType::class, [
        
'label' => 'My other text',
    ])
    ->
add('submit'SubmitType::class, [
        
'label' => 'Submit data',
    ])
    ->
getForm();

echo 
$twig->render('form', [
    
'form' => $form->createView(),
]);
Result
Used Versions
PHP 7.1, Zend 3.0, Symfony 3.2, Laravel 5.2, PHPUnit 5.6, Doctrine 2.6