TYPO3 EXT:femanager 扩展了选择字段

问题描述 投票:0回答:1

我按照如何用我自己的领域扩展 femanager 的例子...... (https://docs.typo3.org/p/in2code/femanager/7.3/en-us/Features/NewFields/Index.html

我需要添加一个列出多种用户类型的选择字段...... 我已经解决了这个错误:

The argument "options" was registered with type "array", but is of type "string" in view helper "In2code\Femanager\ViewHelpers\Form\SelectViewHelper". 

我的新字段部分调用表单字段,如下所示:

<femanager:form.select
  id="femanager_field_usertype"
  property="userType"
  options="{1:private, 2:business, 3:real estate agent}"
  defaultOption="{f:translate(key:'pleaseChoose')}"
  class="form-control"
  additionalAttributes="{femanager:Validation.FormValidationData(settings:settings,fieldName:'userType')}" />

我的合作伙伴:

  • TYPO3 V11.5.37
  • 女性经理7.3.1
typo3 typo3-11.x femanager
1个回答
1
投票

问题似乎出在 options 属性上:

将其更改为:

options="{1:private, 2:business, 3:real estate agent}"

至:

options="{1: 'private', 2: 'business', 3: 'real estate agent'}"
© www.soinside.com 2019 - 2024. All rights reserved.