qbus/contao-configform-bundle
Composer 安装命令:
composer require qbus/contao-configform-bundle
包简介
Define forms using config files instead of the form generator.
README 文档
README
Use config files instead of the form generator to define forms. This makes forms more easily portable.
The forms behave the same way Form Generator forms do because they are rendered, validated and processed by the Contao core. This means, for instance:
- Form hooks, like
compileFormFieldsandprepareFormData, are available; - Form settings like
sendViaEmailcan be used.
Example usage
Create a config file templates/[theme-name/]formconfig_contact.php:
<?php
return [
'tl_form' => [
'title' => 'Contact',
'sendViaEmail' => true,
'format' => 'email',
'subject' => 'Contact via website form',
'tableless' => true
],
'tl_form_field' => [
[
'type' => 'text',
'name' => 'email',
'label' => 'Email',
'mandatory' => true,
'rgxp' => 'email'
],
[
'type' => 'text',
'name' => 'subject',
'label' => 'Subject',
'mandatory' => true
],
[
'type' => 'textarea',
'name' => 'message',
'label' => 'Message',
'mandatory' => true,
'size' => serialize([8,12])
],
[
'type' => 'submit',
'slabel' => 'Send'
]
]
];
In the Contao backend, create a front end module of the type Form from config file and select the config.
Use the module wherever the form shall be inserted.
统计信息
- 总下载量: 47
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: LGPL-3.0
- 更新时间: 2018-11-28