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.

39 lines
1.2KB

  1. <?php
  2. namespace Lc\SovBundle\Controller\Newsletter;
  3. use EasyCorp\Bundle\EasyAdminBundle\Field\FormField;
  4. use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
  5. use Lc\SovBundle\Container\Newsletter\NewsletterContainer;
  6. use Lc\SovBundle\Controller\AbstractAdminController;
  7. use Lc\SovBundle\Factory\Newsletter\NewsletterFactory;
  8. use Lc\SovBundle\Field\BooleanField;
  9. use Lc\SovBundle\Field\CKEditorField;
  10. use Lc\SovBundle\Field\StatusField;
  11. abstract class NewsletterAdminController extends AbstractAdminController
  12. {
  13. public function configureFields(string $pageName): iterable
  14. {
  15. return array_merge(
  16. [
  17. FormField::addPanel('general'),
  18. TextField::new('title'),
  19. BooleanField::new('isMain')
  20. ->setCustomOption('toggle_label', 'Principale'),
  21. CKEditorField::new('description')
  22. ->hideOnIndex(),
  23. StatusField::new('status'),
  24. ],
  25. $this->getSeoPanel(),
  26. $this->getConfPanel()
  27. );
  28. }
  29. public function createEntity(string $entityFqcn)
  30. {
  31. return $this->get(NewsletterContainer::class)->getFactory()->create();
  32. }
  33. }