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.

40 lines
1.2KB

  1. <?php
  2. namespace App\Controller\Admin;
  3. use App\Entity\Site\Page;
  4. use EasyCorp\Bundle\EasyAdminBundle\Config\Assets;
  5. use EasyCorp\Bundle\EasyAdminBundle\Field\ChoiceField;
  6. use EasyCorp\Bundle\EasyAdminBundle\Field\TextEditorField;
  7. use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
  8. use Lc\SovBundle\Controller\Admin\AbstractCrudController;
  9. use Lc\SovBundle\Field\CKEditorField;
  10. use Lc\SovBundle\Field\FileManagerField;
  11. use Lc\SovBundle\Field\GalleryManagerField;
  12. class PageCrudController extends AbstractCrudController
  13. {
  14. public static function getEntityFqcn(): string
  15. {
  16. return Page::class;
  17. }
  18. public function configureFields(string $pageName): iterable
  19. {
  20. return [
  21. TextField::new('title'),
  22. CKEditorField::new('description'),
  23. FileManagerField::new('image'),
  24. ChoiceField::new('status')
  25. ->setChoices(['En ligne' => 1, 'Hors ligne' => 0])
  26. ->setFormTypeOption('expanded', false)
  27. ->setFormTypeOption('multiple', false)
  28. ->setCustomOption('widget', false),
  29. GalleryManagerField::new('gallery'),
  30. TextField::new('devAlias'),
  31. ];
  32. }
  33. }