我的格式如下:
contact:
submission:
ajax: false # Use AJAX for form submission and handling
notification:
enabled: true
debug: false
debug_address: email@example.com # Email address used when debug mode is enabled
debug_smtp: true
subject: Form Submitted
from_name: name # Email addresses and names can be either the
from_email: email # name of a field below or valid text.
replyto_email: email #
replyto_name: name # NOTE: Email addresses must be valid
to_name: name #
to_email: admin@example.com #
feedback:
success: Message submission successful.
error: There are errors in the form, please try again.
fields:
subject:
type: choice
options:
required: true
label: Subject
choices: { 'Partnership': 'Partnership', 'Advertisements': 'Advertisements', 'Technical issues': 'Technical issues', 'Request from the copyright holder': 'Request from the copyright holder', 'General inquiry': 'General inquiry' }
multiple: false
name:
type: text
options:
required: true
label: Name
attr:
placeholder: Your name...
constraints: [ NotBlank, { Length: { 'min': 2, 'max': 64 } } ]
email:
type: email
options:
required: true
label: Email address
attr:
placeholder: Your email...
constraints: [ NotBlank, Email ]
message:
type: textarea
options:
required: true
label: Your message
attr:
placeholder: Your message...
class: myclass
needreply:
type: choice
options:
required: false
label: Do you want us to contact you back?
choices: { 'Yes': 'yes', 'No': 'no' }
multiple: false
submit:
type: submit
options:
label: Submit my message
attr:
class: button primary
remote_ip:
type: hidden
options:
label: false
event:
name: server_value
params:
key: REMOTE_ADDR
sent_on:
type: hidden
options:
label: false
event:
name: timestamp
params:
format: '%F %T'
database:
table: boltforms_contact_us
然后我在boltforms_contact_us
数据库中创建了一个名为bolt
的表,其中包含以下各列:
但是,当我提交表单时,它总是说:Failed attempt to save submission: missing database table 'boltforms_contact_us'
。如您所见,具有相应名称的表已存在,并包含必需的列。那么为什么说没有这样的桌子呢?
P.S。我知道我可以改用ContentType方法,但是我想使用这种方法。 P.P.S.我检查了特权,这些特权与bolt数据库中其他表的特权相同。
**
**
原来,Boltforms看不到手动创建的表,当我转储它使用的$tables
数组时,它仅显示由Bolt本身创建的表。对我来说,这似乎是个错误,我现在必须通过从源代码中删除表来禁用表存在性检查。不过,它完全能够将数据保存到该表中,只是无法检查它是否存在。