N°8772 - Form dependencies manager implementation - WIP

This commit is contained in:
Eric Espie
2025-10-23 15:11:14 +02:00
parent 98c0b11db7
commit fd449d195d
13 changed files with 133 additions and 55 deletions

View File

@@ -3,17 +3,17 @@
namespace Combodo\iTop\Forms\Block;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormInterface;
class FormBlock extends AbstractFormBlock
{
public const OUTPUT_VALUE = 'value';
public function __construct(string $sName, array $aOptions = [])
{
$aOptions['form_block'] = $this;
parent::__construct($sName, $aOptions);
}
public function GetFormType(): string
{
return FormType::class;
@@ -25,14 +25,6 @@ class FormBlock extends AbstractFormBlock
public function InitOutputs(): void
{
}
public function Build(FormBuilderInterface $oBuilder): FormInterface
{
foreach ($this->GetSubFormBlocks() as $oSubForm) {
$oBuilder->add($oSubForm->GetName(), $oSubForm->GetFormType(), $oSubForm->GetOptions());
}
return $oBuilder->getForm();
$this->AddOutput(new FormOutput(self::OUTPUT_VALUE, 'string'));
}
}