Exemple #1
0
 /**
  * Adds or changes a specific aspect of provided from
  *
  * @param ContainerInterface|FormInterface $form
  * @param array $data
  *
  * @return void
  */
 public static function execute(ContainerInterface $form, array $data)
 {
     $input = new Hidden();
     $input->setValue($data['id'])->setName('form-id');
     if ($form instanceof FormInterface) {
         $form->setId($data['id']);
     }
     $form->add($input);
 }
Exemple #2
0
 /**
  * Adds or changes a specific aspect of provided from
  *
  * @param ContainerInterface $form
  * @param array $data
  *
  * @return void
  */
 public static function execute(ContainerInterface $form, array $data)
 {
     self::$form = $form;
     $hasElements = isset($data['elements']) && is_array($data['elements']);
     if (!$hasElements) {
         return;
     }
     foreach ($data['elements'] as $name => $element) {
         $input = self::create($element);
         $input->setName($name);
         self::populateInputs($input, $element);
         $form->add($input);
     }
 }