public function buildFormConfig(FormElementConfigInterface $config) { $element = $config->getFormElement(); // Set Form Element Type $config->setType($element->getType()); // Set Form Element Name $name = $element->getName(); $name = empty($name) ? $element->getId() : $element->getName(); $config->setName($name); if ($element->getOption('required')) { $config->addConstraint(new NotBlank()); } }
public function buildFormConfig(FormElementConfigInterface $config) { $config->addConstraint(new Email()); }