-
Notifications
You must be signed in to change notification settings - Fork 462
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 #1725 from thomasnares/missingTypes2
Missing form types
- Loading branch information
Showing
66 changed files
with
1,145 additions
and
58 deletions.
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
15 changes: 15 additions & 0 deletions
15
development/components/form/types-reference/accordion-type.md
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,15 @@ | ||
--- | ||
title: AccordionType | ||
--- | ||
|
||
# AccordionType | ||
|
||
This form type is used as a container of sub forms, each sub form will be rendered as a part of an accordion. | ||
|
||
- Namespace: PrestaShopBundle\Form\Admin\Type | ||
- Reference: [AccordionType](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Form/Admin/Type/AccordionType.php) | ||
|
||
## Type options | ||
|
||
| Option | Type | Default value | Description | | ||
| :----------- | :----- | :-------------------------------- | :---------------------------------------------------------------------------------------- | |
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
64 changes: 64 additions & 0 deletions
64
development/components/form/types-reference/button-collection.md
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,64 @@ | ||
--- | ||
title: ButtonCollectionType | ||
--- | ||
|
||
# ButtonCollectionType | ||
|
||
`ButtonCollectionType` is a form type used to group buttons in a common form group, which is useful for forms that have multiple submit buttons. | ||
|
||
- Namespace: `PrestaShopBundle\Form\Admin\Type` | ||
- Reference: [ButtonCollectionType](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Form/Admin/Type/ButtonCollectionType.php) | ||
|
||
## Type options | ||
|
||
| Option | Type | Default value | Description | | ||
| :----------- | :----- | :-------------------------------- | :---------------------------------------------------------------------------------------- | | ||
| label | `boolean` | `false` | | | ||
| name | `string` | `` | | | ||
| justify_content | `string` | `space-between` | | | ||
| buttons | `array` | `[]` | | | ||
|
||
## Code example | ||
|
||
- [CombinationItemType.php](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Form/Admin/Sell/Product/Combination/CombinationItemType.php#L150-L183) | ||
|
||
```php | ||
$builder->add('actions', ButtonCollectionType::class, [ | ||
'buttons' => [ | ||
'edit' => [ | ||
'type' => IconButtonType::class, | ||
'options' => [ | ||
'icon' => 'mode_edit', | ||
'attr' => [ | ||
'class' => 'edit-combination-item tooltip-link', | ||
'data-toggle' => 'pstooltip', | ||
'data-original-title' => $this->trans('Edit', 'Admin.Actions'), | ||
], | ||
], | ||
], | ||
'delete' => [ | ||
'type' => IconButtonType::class, | ||
'options' => [ | ||
'icon' => 'delete', | ||
'attr' => [ | ||
'class' => 'delete-combination-item tooltip-link', | ||
'data-modal-title' => $this->trans('Delete item', 'Admin.Notifications.Warning'), | ||
'data-modal-message' => $this->trans('Delete selected item?', 'Admin.Notifications.Warning'), | ||
'data-modal-apply' => $this->trans('Delete', 'Admin.Actions'), | ||
'data-modal-cancel' => $this->trans('Cancel', 'Admin.Actions'), | ||
'data-toggle' => 'pstooltip', | ||
'data-original-title' => $this->trans('Delete', 'Admin.Actions'), | ||
], | ||
], | ||
], | ||
], | ||
'label' => $this->trans('Actions', 'Admin.Global'), | ||
'attr' => [ | ||
'class' => 'combination-row-actions', | ||
], | ||
]) | ||
``` | ||
|
||
## Preview example | ||
|
||
{{< figure src="../img/button-collection.png" title="ButtonCollectionType rendered in form example" >}} |
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
Oops, something went wrong.