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.

27 lines
766B

  1. <?php
  2. namespace Lc\PietroBundle\Controller\Subthematic;
  3. use Lc\PietroBundle\Container\Subthematic\SubthematicContainer;
  4. use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField;
  5. use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
  6. use Lc\PietroBundle\Controller\AbstractAdminController;
  7. abstract class SubthematicAdminController extends AbstractAdminController
  8. {
  9. public function createEntity(string $entityFqcn)
  10. {
  11. return $this->getSubthematicContainer()->getFactory()->create();
  12. }
  13. public function configureFields(string $pageName): iterable
  14. {
  15. return [
  16. TextField::new('name'),
  17. AssociationField::new('thematic')
  18. ->setTemplatePath('crud/field/association.html.twig')
  19. ];
  20. }
  21. }