// form is initialized. This makes sure that dynamically added or
// removed fields are already visible after initialization.
if(!$this->defaultDataSet){ $this->setData($this->config->getData()); }
publicfunctionsubmit(mixed $submittedData, bool $clearMissing = true): static { if($this->submitted){ thrownewAlreadySubmittedException('A form can only be submitted once.'); }
// Initialize errors in the very beginning so we're sure
$this->translator = $translator; }
/**
* @return void
*/ publicfunctionbuildForm(FormBuilderInterface $builder, array $options) { // Ensure that submitted data is always an uploaded file or an array of some
$builder->addEventListener(FormEvents::PRE_SUBMIT, function DFormEvent $event)use($options){ $form = $event->getForm(); $requestHandler = $form->getConfig()->getRequestHandler();