我正在使用从管理面板运行的grav插件。我已使用自定义模板将新页面添加到管理导航侧栏,现在我想通过文件上传向其添加多个表单。出于测试目的,我从一个表单开始,虽然当我在模板中使用{% include "forms/form.html.twig" %}
时它确实会生成表单,但是当我尝试指定要使用{% include "forms/form.html.twig" with { form: forms('testing') } %}
生成哪个表单时,它只是空白。关于如何解决此问题的任何想法吗?
我要呈现的表单示例
forms:
testing:
method: POST
fields:
action:
type: hidden
default: "create"
new_project_name:
label: New project name
type: text
size: small
new_description:
type: Textarea
label: 'Project description'
name: 'new_description'
id: 'new_description'
new_project_files:
type: file
label: Project files
multiple: True
destination: user/pages/media/
name: 'new_project_files'
id: 'new_project_files'
accept:
- image/*
- audio/*
- video/*
create_history:
label: Share with sycamore
type: radio
name: create_history
default: true
required: true
options:
True: yes
False: no
buttons:
- type: submit
value: Submit
process:
custom_upload: "create"