~~~
$formBuilder->fields = [
'username' => form_fields_helper(FieldsOptions::CONTROL_TEXT, [
'label' => '用户名',
'placeholder' => '请输入用户名',
]),
'number' => form_fields_helper(FieldsOptions::CONTROL_NUMBER, [
'label' => '编号',
'placeholder' => '请输入编号',
'attribute' => [
'max' => 1000,
'min' => 1,
]
]),
'password' => form_fields_helper(FieldsOptions::CONTROL_PASSWORD, [
'label' => '密码',
'placeholder' => '请输入密码',
]),
'mark' => form_fields_helper(FieldsOptions::CONTROL_TEXTAREA, [
'label' => '备注',
'placeholder' => '请填写备注,字数范围5-250',
]),
];
~~~
> 注:具体用法详见代码传参