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 797B

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