N°8771 - Add Symfony form component to iTop core

- IO debug
This commit is contained in:
Benjamin Dalsass
2025-10-28 15:33:28 +01:00
parent 5d335b39d2
commit 6952bfa978
25 changed files with 397 additions and 226 deletions

View File

@@ -0,0 +1,47 @@
<?php
/*
* @copyright Copyright (C) 2010-2025 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Forms\Block\Base;
use Combodo\iTop\Forms\Block\AbstractFormBlock;
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
/**
* Collection form type.
*
*/
class CollectionBlock extends AbstractFormBlock
{
public function __construct(string $sName, array $aOptions = [])
{
parent::__construct($sName, $aOptions);
}
/** @inheritdoc */
public function GetFormType(): string
{
return CollectionType::class;
}
/** @inheritdoc */
public function InitOptions(): array
{
$sBlockEntryType = $this->GetOptions()['block_entry_type'];
$sBlockEntryOptions = $this->GetOptions()['block_entry_options'];
$this->aOptions = [];
$oBlock = new ($sBlockEntryType)('prototype', $sBlockEntryOptions);
return [
'entry_type' => $oBlock->GetFormType()
];
}
}