-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from bolt/feature/split-forms-in-multiple-files
Split forms config in a `config/extensions/bolt-boltforms/` folder
- Loading branch information
Showing
3 changed files
with
100 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
csfix: | ||
vendor/bin/ecs check src --fix | ||
make stancheck | ||
|
||
|
||
stancheck: | ||
vendor/bin/phpstan --memory-limit=1G analyse -c phpstan.neon src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,67 @@ your very own Bolt form is located in `config/extensions/bolt-boltforms.yaml`. | |
|
||
The first time you open it, you'll see a few options are already defined for you. | ||
The default configuration file includes a lot of comments to help you get started. | ||
|
||
If you have a few forms and managing the `config/extensions/bolt-boltforms.yaml` | ||
file becomes a chore, you can split each form into its own file in `config/extensions/bolt-boltforms/`. | ||
|
||
For example, `config/extensions/bolt-boltforms/contact.yaml` will create a form called `contact`. | ||
Note, you should **only** put the configuration for this form, for example: | ||
|
||
```yaml | ||
notification: | ||
enabled: true | ||
debug: false | ||
debug_address: [email protected] # Email address used when debug mode is enabled | ||
debug_smtp: true | ||
subject: Your message was submitted | ||
subject_prefix: '[Boltforms]' | ||
replyto_name: '{NAME}' # Email addresses and names can be either the | ||
replyto_email: '{EMAIL}' # name of a field below or valid text. | ||
to_name: 'WebsiteName' | ||
to_email: '[email protected]' | ||
from_name: 'WebsiteName' | ||
from_email: '[email protected]' | ||
feedback: | ||
success: Message submission successful | ||
error: There are errors in the form, please fix before trying to resubmit | ||
fields: | ||
name: | ||
type: text | ||
options: | ||
required: true | ||
label: Name | ||
attr: | ||
placeholder: Your name... | ||
constraints: [ NotBlank, { Length: { 'min': 3, 'max': 128 } } ] | ||
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 | ||
``` | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters