我按照如何用我自己的领域扩展 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')}" />
我的合作伙伴:
问题似乎出在 options 属性上:
将其更改为:
options="{1:private, 2:business, 3:real estate agent}"
至:
options="{1: 'private', 2: 'business', 3: 'real estate agent'}"