Skip to content

Commit

Permalink
[shopsys] markdown format ensured by prettier (#2892)
Browse files Browse the repository at this point in the history
  • Loading branch information
grossmannmartin authored Oct 26, 2023
2 parents 641a3e6 + d6f6a98 commit 692d1f4
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,21 @@ Symfony bundle adding form types for usage in [Shopsys Platform](https://www.sho
This repository is maintained by [shopsys/shopsys] monorepo, information about changes is in [monorepo CHANGELOG.md](https://github.com/shopsys/shopsys/blob/master/CHANGELOG.md).

## Installation

The plugin is a Symfony bundle and is installed in the same way:

### Download

First, you download the package using [Composer](https://getcomposer.org/):

```
composer require shopsys/form-types
```

### Register

For the bundle to be loaded in your application you need to register it in the `app/AppKernel.php` file of your project:

```php
// ...
class AppKernel extends Kernel
Expand All @@ -39,28 +44,32 @@ class AppKernel extends Kernel
```

## How to use a custom form type

The form types in this package are regular Symfony form types.
See [Symfony Forms Documentation](https://symfony.com/doc/current/forms.html) for detailed explanation.

## Contents

### [MultidomainType](./src/MultidomainType.php)

Compound type that renders one form of given type for each domain.

It can be configured via the following options:
* `entry_type` - The type of the inner form.
Defaults to `TextType::class`.
* `entry_options` - The options of the inner forms.
Defaults to `[]`.
* `options_by_domain_id` - The options of the inner forms based on the domain ID.
Provide arrays indexed by the domain ID, values are merged with the `entry_options`.
Defaults to `[]`.

- `entry_type` - The type of the inner form.
Defaults to `TextType::class`.
- `entry_options` - The options of the inner forms.
Defaults to `[]`.
- `options_by_domain_id` - The options of the inner forms based on the domain ID.
Provide arrays indexed by the domain ID, values are merged with the `entry_options`.
Defaults to `[]`.

The data of the inner forms are returned as an array indexed by the domain ID.

![MultidomainType usage example](./docs/images/multidomain_type_example.png)

### [YesNoType](./src/YesNoType.php)

Natural looking choice type for boolean value inputs.

It has no notable options.
Expand All @@ -71,6 +80,7 @@ A null value can be accepted/returned when no radio button is checked.
![YesNoType usage example](./docs/images/yes_no_type_example.png)

## Contributing

Thank you for your contributions to Shopsys Form Types Bundle package.
Together we are making Shopsys Platform better.

Expand All @@ -81,9 +91,10 @@ please use the main [Shopsys repository](https://github.com/shopsys/shopsys).
Please, check our [Contribution Guide](https://github.com/shopsys/shopsys/blob/master/CONTRIBUTING.md) before contributing.

## Support

What to do when you are in troubles or need some help?
The best way is to join our [Slack](https://join.slack.com/t/shopsysframework/shared_invite/zt-11wx9au4g-e5pXei73UJydHRQ7nVApAQ).

If you want to [report issues](https://github.com/shopsys/shopsys/issues/new), please use the main [Shopsys repository](https://github.com/shopsys/shopsys).

[shopsys/shopsys]:(https://github.com/shopsys/shopsys)
[shopsys/shopsys]: (https://github.com/shopsys/shopsys)

0 comments on commit 692d1f4

Please sign in to comment.