mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-26 03:58:45 +02:00
N°7063 - Forms SDK - Add Symfony forms component
error forms issue
This commit is contained in:
@@ -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']){
|
||||
|
||||
Reference in New Issue
Block a user