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

29 行
899B

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