N°8771 - Add Symfony form component to iTop core

- IO
This commit is contained in:
Benjamin Dalsass
2025-10-24 07:15:35 +02:00
parent 5582afe5ae
commit a51272f107
15 changed files with 233 additions and 44 deletions

View File

@@ -7,25 +7,33 @@
namespace Combodo\iTop\Forms\Block\DataModel;
use Combodo\iTop\Forms\Block\Base\ChoiceFormBlock;
use Combodo\iTop\Forms\Block\FormInput;
use Combodo\iTop\Forms\Block\IO\Format\AttributeIOFormat;
use Combodo\iTop\Forms\Block\IO\Format\ClassIOFormat;
use Combodo\iTop\Forms\Block\IO\FormInput;
/**
* Form block for choice of class attribute values.
*
* @package DataModel
*/
class AttributeValueChoiceFormBlock extends ChoiceFormBlock
{
// inputs
public const INPUT_CLASS_NAME = 'class_name';
public const INPUT_ATTRIBUTE = 'attribute';
public function __construct(string $sName, array $aOptions = [])
/** @inheritdoc */
public function InitOptions(array &$aOptions = []): void
{
$aOptions['multiple'] = true;
parent::__construct($sName, $aOptions);
}
/** @inheritdoc */
public function InitInputs(): void
{
$this->AddInput(new FormInput(self::INPUT_CLASS_NAME, 'string'));
$this->AddInput(new FormInput(self::INPUT_ATTRIBUTE, 'string'));
parent::InitInputs();
$this->AddInput(new FormInput(self::INPUT_CLASS_NAME, ClassIOFormat::class));
$this->AddInput(new FormInput(self::INPUT_ATTRIBUTE, AttributeIOFormat::class));
}
}