1

我遵循了Xavier Perseguers 编写的要点,以便为我在 TYPO3 v8 中使用 EXT:form 创建的表单添加一个自定义整理器。

我做了一些修改来添加一个选择。

# EXT:my_ext/Configuration/Yaml/CreateRequestActionFrontend.yaml
TYPO3:
  CMS:
    Form:
      prototypes:
          # add our finisher to the 'standard' form prototype
          standard:
            formElementsDefinition:
          Form:
            formEditor:
              editors:
                # 900 = 'finishers' in EXT:form/Configuration/Yaml/FormEditorSetup.yaml
                900:
                  selectOptions:
                    500:
                      value: 'CreateRequestAction'
                      label: 'Create request'

              propertyCollections:
                finishers:
                  500:
                    __inheritances:
                      10:'TYPO3.CMS.Form.mixins.FormEngineCreateRequestActionMixin'
                    identifier: 'CreateRequestAction'
                    editors:
                      __inheritances:
                        10: 'TYPO3.CMS.Form.mixins.formElementMixins.BaseCollectionEditorsMixin'
                      100:
                        label: 'Create request'
                      200:
                        identifier: 'requestType'
                        templateName: 'Inspector-SingleSelectEditor'
                        label: 'Request type'
                        propertyPath: 'options.requestType'
                        selectOptions:
                          10:
                            value: '1'
                            label: 'OPTION 1'
                          20:
                            value: '2'
                            label: 'OPTION 2'
                          30:
                            value: '3'
                            label: 'OPTION 3'

            finishersDefinition:
              CreateRequestAction:
                formEditor:
                  iconIdentifier: 't3-form-icon-finisher'
                  predefinedDefaults:
                    options:
                      requestType: '1'

      mixins:
        FormEngineCreateRequestActionMixin:
          elements:
            requestType:
              config:
                type: 'select'

另一方面,我的数据库中存储了域对象;我希望这些对象成为选择选项。我的问题是:我该怎么做?

太感谢了。

4

0 回答 0