add doc about form helpers
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Simon Vieille 2023-10-11 23:30:42 +02:00
parent 7c180c3bbb
commit acd8b2a20c
Signed by: deblan
GPG key ID: 579388D585F70417
2 changed files with 21 additions and 0 deletions

20
docs/utils/form.md Normal file
View file

@ -0,0 +1,20 @@
# Form
## File picker
Murph provides a file picker using the file manager system: `App\Core\Form\FileManager\FilePickerType`. It allows you to pick an existing file or upload it. After saving, the file is previewed if possible.
## Collection
When you need to manage a collection in a form, you can use `App\Core\Form\Type\CollectionType` with these options:
| Option | Type | Default | Description |
| ------ | ---- | ------- | ----------- |
| `collection_name` | `string` | `null` | Unique name of the collection |
| `label_add` | `string` | `Add` | Unique name of the collection |
| `label_delete` | `string` | `Delete` | Unique name of the collection |
| `template_before_item` | `string` | `null` | A template included before an existing itam of the collection |
| `template_after_item` | `string` | `null` | A template included after an existing itam of the collection |
...and and all options of a symfony collection type.

View file

@ -99,6 +99,7 @@ nav:
- File attribute: utils/file_attribute.md
- Mail notifier: utils/mail.md
- Slug: utils/slug.md
- Form: utils/form.md
- "A/B Testing": abtesting.md
- Users: users.md
- Tasks: tasks.md