N°7063 - Forms SDK - Add Symfony forms component

error forms issue
This commit is contained in:
Benjamin Dalsass
2024-01-09 12:42:48 +01:00
parent 153027434d
commit 5213e205af
12 changed files with 192 additions and 40 deletions

View File

@@ -72,7 +72,24 @@ class FormHelper
'notify' => true,
'language' => 'FR FR',
'mode' => '1',
'options' => ['0', '2','4']
'options' => ['0', '2', '4'],
'collection' => [
[
'text1' => 'Benjamin',
'text2' => 'DALSASS',
'date1' => new DateTime('1979/06/27')
],
[
'text1' => 'Nelly',
'text2' => 'DALSASS',
'date1' => new DateTime('1977/04/6')
],
[
'text1' => 'Léonard',
'text2' => 'BASTID',
'date1' => new DateTime('1975/03/16')
]
]
];
$oFormFactory->SetData($aData);
@@ -225,6 +242,24 @@ class FormHelper
]
]);
// options - select with static data
$oText1 = new FormFieldDescription('text1', FormFieldTypeEnumeration::TEXT, []);
$oText2 = new FormFieldDescription('text2', FormFieldTypeEnumeration::TEXT, []);
$oDate = new FormFieldDescription('date1', FormFieldTypeEnumeration::DATE, [
'widget' => 'single_text'
]);
$oFormFactory->AddCollectionField('collection', [
'label' => 'Une Collection',
'element_type' => FormFieldTypeEnumeration::FIELDSET,
'fields_labels' => ['Prénom', 'Nom', 'Naissance'],
'element_options' => [
'fields' => [
'text1' => $oText1,
'text2' => $oText2,
'date1' => $oDate]
]
]);
}
if(self::$MODES_DEFINITIONS[$iMode]['layout']){