mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-22 18:18:46 +02:00
SDK Form demonstrator delegate ... to the iTop Form Builder
This commit is contained in:
@@ -108,9 +108,15 @@ class FormBuilder implements FormBuilderInterface, \IteratorAggregate
|
||||
throw new \Exception("type must be an instance of AbstractType (found $type)");
|
||||
}
|
||||
$oType = new $type();
|
||||
if (is_null($oType->GetPrerequisites($options))) {
|
||||
$aPrerequisites = $oType->GetPrerequisites($options);
|
||||
if (is_null($aPrerequisites)) {
|
||||
$this->builder->add($child, $type, $options);
|
||||
} else {
|
||||
$this->aDynamicFields[$child] = [
|
||||
'type' => $type,
|
||||
'prerequisites' => $aPrerequisites,
|
||||
'user_options' => $options,
|
||||
];
|
||||
$this->builder->add($child, HiddenType::class, ['mapped' => false]);
|
||||
}
|
||||
return $this;
|
||||
|
||||
Reference in New Issue
Block a user