Ver Fonte

add help message as parameter

Andrej Hudec há 13 anos atrás
pai
commit
456f86b425
1 ficheiros alterados com 10 adições e 0 exclusões
  1. 10 0
      Form/FormMapper.php

+ 10 - 0
Form/FormMapper.php

@@ -124,7 +124,17 @@ class FormMapper
                 $options['label'] = $this->admin->getLabelTranslatorStrategy()->getLabel($fieldDescription->getName(), 'form', 'label');
             }
 
+            $help = null;
+            if (isset($options['help'])) {
+                $help = $options['help'];
+                unset($options['help']);
+            }
+
             $this->formBuilder->add($name, $type, $options);
+
+            if (null !== $help) {
+                $this->admin->getFormFieldDescription($name)->setHelp($help);
+            }
         }
 
         return $this;