typo3flexformtca

How to convert typo3 tca definitions to xml


I have a TCA definition. But Flexforms in T3 use the same syntax but XML format I would like to convert the existing file to XML.

Is there a simple way to do this?

        'icon_file' => [
            'label' => 'LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:field.icon_file',
            'displayCond' => 'FIELD:icon_set:REQ:false',
            'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
                'icon_file',
                [
                    'appearance' => [
                        'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference'
                    ],
                    'overrideChildTca' => [
                        'types' => [
                            \TYPO3\CMS\Core\Resource\File::FILETYPE_UNKNOWN => [
                                'showitem' => '
                                    --palette--;;filePalette
                                '
                            ],
                            \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [
                                'showitem' => '
                                    --palette--;;filePalette
                                '
                            ],
                            \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
                                'showitem' => '
                                    --palette--;;filePalette
                                '
                            ],
                            \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [
                                'showitem' => '
                                    --palette--;;filePalette
                                '
                            ],
                            \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [
                                'showitem' => '
                                    --palette--;;filePalette
                                '
                            ],
                            \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [
                                'showitem' => '
                                    --palette--;;filePalette
                                '
                            ],
                        ],
                    ],
                    'minitems' => 1,
                    'maxitems' => 1,
                ],
                'gif,png,svg'
            ),
        ],

I don't know what the TCA syntax is? JSON - no! JAVASCRIPT - no! What syntax type is this with "=> [" ...?


Solution

  • TYPO3's table configuration array (TCA) is an array structure built on PHP arrays. The syntax [] is the short form of array(), so ['one', 'two'] is the same as array('one', 'two').

    AFAIK there is no automated way to transform TCA (PHP) to FlexForm (XML) but the FlexForm documentation is a good starting point to learn how to create FlexForms.

    Please note that you do have all the features of TCA in FlexForms but you need to write it in XML syntax instead of the PHP syntax.