I was wondering if it's possible to modify form configuration after the form object has been initialized (I define my form as a service).
Namely, when creating a form in a controller, we could do this:
$form = $this->createForm('some_form_type', $entity, ['some_key' => true]);
but then what if I want to modify $options
after initialization.
FormInterface
exposes getConfig()
method that returns FormConfigInterface
so we have direct access to the configuration object. This object, however, does not expose any setters. FormInterface
also does not expose any configuration setter methods.
In short, do you know of a way to modify a form configuration object after initilizaing the form object?