form.context
serviceはSymfony\Component\Form\FormContext
デフォルトでオブジェクトです。このサービスの完全な定義は次のとおりです。
<service id="form.context" class="%form.context.class%">
<argument type="collection">
<argument key="validator" type="service" id="validator" />
<argument key="validation_groups">%form.validation_groups%</argument>
<argument key="field_factory" type="service" id="form.field_factory" />
<argument key="csrf_protection">%form.csrf_protection.enabled%</argument>
<argument key="csrf_field_name">%form.csrf_protection.field_name%</argument>
<argument key="csrf_provider" type="service" id="form.csrf_provider" />
</argument>
</service>
実際には、ほとんどすべてのフォームで使用されるいくつかの基本的なオプションを準備するだけの非常に単純なオブジェクトです。バリデーター、CSRF保護、フィールドファクトリー。
実際、投稿したコードは次のものと同等です。
$form = new \Symfony\Components\Form\Form(null, array(
'validator' => $this->get('validator'),
'validation_groups' => ...
...
));