braunstetter / choosy-type
The FormType for the @michael-brauner/choosy choice-picker.
Installs: 9
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^8.0
- symfony/asset: ^6.0
- symfony/debug-bundle: ^6.0
- symfony/doctrine-bridge: ^6.0
- symfony/form: ^6
- symfony/framework-bundle: ^4.4|^5.0|^6.0
- symfony/twig-bundle: ^6.0
Requires (Dev)
- dbrekelmans/bdi: ^1.0
- doctrine/doctrine-bundle: ^2.8
- doctrine/orm: ^2.14
- matthiasnoback/symfony-dependency-injection-test: ^4.2
- nyholm/symfony-bundle-test: ^2.0
- symfony/panther: ^2.0
- symfony/test-pack: ^1.0
- symfony/var-dumper: ^6.2
README
This bundle brings @michael-brauner/choosy
into your symfony application.
It is just a nice wrapper around the standard symfony ChoiceType
and EntityType
form fields.
It gives you the ability to turn it into a nice tag picker.
Installation
composer require braunstetter/choosy
Usage
$form->add('choices', ChoosyType::class, [ 'choices' => [ 'Maybe' => null, 'Yes' => true, 'No' => false, ], ]); // for entities $form->add('choices', ChoosyEntityType::class, [ 'class' => Tag:class ]);
Options
You can pass the same options as you would do directly to the javascript component.
All available options are documented here.
Contributing
If you think this bundle could still be improved and expanded, then we welcome your PR.
Testing
To make sure everything works fine - you have to run the test suite.
You need to make sure Panther is working properly on your machine. Then your tests should work fine performing a simple:
composer install vendor/bin/bdi detect drivers yarn --cwd ./src/Resources/assets install --force yarn --cwd ./tests/app install --force yarn --cwd ./src/Resources/assets dev yarn --cwd ./tests/app dev ./vendor/phpunit/phpunit/phpunit