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\Container\Site\PageContainer;
  7. use Lc\SovBundle\Controller\AbstractAdminController;
  8. use Lc\SovBundle\Factory\Site\PageFactory;
  9. use Lc\SovBundle\Field\CKEditorField;
  10. use Lc\SovBundle\Field\StatusField;
  11. abstract class PageAdminController 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. NumberField::new('position')
  21. ->hideOnIndex()
  22. ->hideOnForm(),
  23. CKEditorField::new('description'),
  24. StatusField::new('status'),
  25. ],
  26. $panel
  27. );
  28. }
  29. public function createEntity(string $entityFqcn)
  30. {
  31. return $this->get(PageContainer::class)->getFactory()->create();
  32. }
  33. }