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\Site;
  3. use EasyCorp\Bundle\EasyAdminBundle\Field\DateField;
  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\AbstractAdminController;
  8. use Lc\SovBundle\Field\CKEditorField;
  9. use Lc\SovBundle\Field\ImageManagerField;
  10. use Lc\SovBundle\Field\StatusField;
  11. abstract class NewsAdminController extends AbstractAdminController
  12. {
  13. public function configureFields(string $pageName): iterable
  14. {
  15. $panel = parent::configureFields($pageName);
  16. return array_merge(
  17. [
  18. FormField::addPanel('general'),
  19. TextField::new('title'),
  20. DateField::new('date')
  21. ->setFormat('d/MM/y'),
  22. NumberField::new('position')
  23. ->hideOnIndex()
  24. ->hideOnForm(),
  25. CKEditorField::new('description'),
  26. StatusField::new('status'),
  27. ],
  28. $panel
  29. );
  30. }
  31. }