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.

45 lines
1.3KB

  1. <?php
  2. namespace App\Controller\Admin;
  3. use App\Entity\Site\Page;
  4. use EasyCorp\Bundle\EasyAdminBundle\Field\FormField;
  5. use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField;
  6. use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
  7. use Lc\SovBundle\Controller\Admin\AbstractCrudController;
  8. use Lc\SovBundle\Field\BooleanField;
  9. use Lc\SovBundle\Field\CKEditorField;
  10. use Lc\SovBundle\Field\FileManagerField;
  11. use Lc\SovBundle\Field\GalleryManagerField;
  12. use Lc\SovBundle\Field\ImageManagerField;
  13. use Lc\SovBundle\Field\StatusField;
  14. class PageCrudController extends AbstractCrudController
  15. {
  16. public static function getEntityFqcn(): string
  17. {
  18. return Page::class;
  19. }
  20. public function configureFields(string $pageName): iterable
  21. {
  22. $panel = parent::configureFields($pageName);
  23. return array_merge(
  24. [
  25. FormField::addPanel('Général'),
  26. TextField::new('title'),
  27. NumberField::new('position')->hideOnForm(),
  28. CKEditorField::new('description'),
  29. FileManagerField::new('file'),
  30. StatusField::new('status'),
  31. FormField::addPanel('Galerie'),
  32. GalleryManagerField::new('gallery')
  33. ],
  34. $panel
  35. );
  36. }
  37. }