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());
     }
 }
Exemplo n.º 2
0
 public function buildFormConfig(FormElementConfigInterface $config)
 {
     $config->addConstraint(new Email());
 }