Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

27 linhas
741B

  1. <?php
  2. namespace App\Field;
  3. use A2lix\TranslationFormBundle\Form\Type\TranslationsType;
  4. use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
  5. use EasyCorp\Bundle\EasyAdminBundle\Field\FieldTrait;
  6. final class TranslationField implements FieldInterface
  7. {
  8. use FieldTrait;
  9. public static function new(string $propertyName, ?string $label = null, $fieldsConfig = []): self
  10. {
  11. return (new self())
  12. ->setProperty($propertyName)
  13. ->setLabel($label)
  14. ->setFormType(TranslationsType::class)
  15. ->setFormTypeOptions(
  16. [
  17. 'default_locale' => '%locale%',
  18. 'fields' => $fieldsConfig,
  19. ]
  20. );
  21. }
  22. }