You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BooleanField.php 899B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace Lc\SovBundle\Field;
  3. use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
  4. use EasyCorp\Bundle\EasyAdminBundle\Field\FieldTrait;
  5. use Lc\SovBundle\Form\Type\FileManagerType;
  6. use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
  7. use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
  8. use Symfony\Component\Form\Extension\Core\Type\TextType;
  9. /**
  10. * @author La clic ! <contact@laclic.fr>
  11. */
  12. final class BooleanField implements FieldInterface
  13. {
  14. use FieldTrait;
  15. public static function new(string $propertyName, ?string $label = null): self
  16. {
  17. return (new self())
  18. ->setProperty($propertyName)
  19. ->setLabel($label)
  20. ->setTemplatePath('@LcSov/adminlte/crud/field/toggle.html.twig')
  21. ->setFormType(CheckboxType::class);
  22. }
  23. }