您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

BooleanField.php 797B

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. }