TYPO3 8.7.17 EXT:form-使用DB寄存器将选择添加到自定义装订器

时间:2018-08-01 09:54:34

标签: forms typo3 typo3-extensions typo3-8.7.x

我跟随gist written by 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'

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

非常感谢您。

0 个答案:

没有答案