From acd8b2a20ccfffb11d05d77ba67556637fbdfa35 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 11 Oct 2023 23:30:42 +0200 Subject: [PATCH] add doc about form helpers --- docs/utils/form.md | 20 ++++++++++++++++++++ mkdocs.yml | 1 + 2 files changed, 21 insertions(+) create mode 100644 docs/utils/form.md diff --git a/docs/utils/form.md b/docs/utils/form.md new file mode 100644 index 0000000..8a1bb53 --- /dev/null +++ b/docs/utils/form.md @@ -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. diff --git a/mkdocs.yml b/mkdocs.yml index 05127da..82fd115 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -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