Skip to content

Commit

Permalink
Se agregó una opción más para boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
micayael committed Mar 21, 2023
1 parent f38e51f commit 5ae2647
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -124,7 +124,7 @@ Installation
------------

~~~
composer install micayael/form-generator-bundle
composer require micayael/form-generator-bundle
~~~

Usage
Expand Down
16 changes: 16 additions & 0 deletions src/Config/SupportedTypes.php
Expand Up @@ -216,6 +216,22 @@ class SupportedTypes
],
],
],
'boolean_choice' => [
'class' => ChoiceType::class,
'default_options' => [
'required' => false,
'choices' => [
true => 'Si',
false => 'No',
],
'constraints' => [
'type' => [
'type' => 'boolean',
'message' => 'The value {{ value }} is not a valid {{ type }}.',
],
],
],
],
];

public static function getDefaultTypeConfig(string $inputType): array
Expand Down

0 comments on commit 5ae2647

Please sign in to comment.