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.

41 satır
1.2KB

  1. <?php
  2. namespace Lc\SovBundle\Controller\Site;
  3. use EasyCorp\Bundle\EasyAdminBundle\Field\FormField;
  4. use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField;
  5. use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
  6. use Lc\SovBundle\Controller\AbstractAdminController;
  7. use Lc\SovBundle\Factory\Site\PageFactory;
  8. use Lc\SovBundle\Field\CKEditorField;
  9. use Lc\SovBundle\Field\StatusField;
  10. abstract class PageAdminController extends AbstractAdminController
  11. {
  12. public function configureFields(string $pageName): iterable
  13. {
  14. $panel = parent::configureFields($pageName);
  15. return array_merge(
  16. [
  17. FormField::addPanel('general'),
  18. TextField::new('title'),
  19. NumberField::new('position')
  20. ->hideOnIndex()
  21. ->hideOnForm(),
  22. CKEditorField::new('description'),
  23. StatusField::new('status'),
  24. ],
  25. $panel
  26. );
  27. }
  28. public function createEntity(string $entityFqcn)
  29. {
  30. $factory = new PageFactory();
  31. return $factory->create();
  32. }
  33. }