|
1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
-
- namespace Lc\SovBundle\Controller\Newsletter;
-
- use EasyCorp\Bundle\EasyAdminBundle\Field\FormField;
- use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
- use Lc\SovBundle\Controller\AbstractAdminController;
- use Lc\SovBundle\Factory\Newsletter\NewsletterFactory;
- use Lc\SovBundle\Field\BooleanField;
- use Lc\SovBundle\Field\CKEditorField;
- use Lc\SovBundle\Field\StatusField;
-
- abstract class NewsletterAdminController extends AbstractAdminController
- {
- public function configureFields(string $pageName): iterable
- {
- return array_merge(
- [
- FormField::addPanel('general'),
- TextField::new('title'),
- BooleanField::new('isMain')
- ->setCustomOption('toggle_label', 'Principale'),
- CKEditorField::new('description')
- ->hideOnIndex(),
- StatusField::new('status'),
- ],
- $this->getSeoPanel(),
- $this->getConfPanel()
- );
- }
-
- public function createEntity(string $entityFqcn)
- {
- $factory = new NewsletterFactory();
- return $factory->create();
- }
-
- }
|