|
- <?php
-
- namespace App\Controller\Admin;
-
- use App\Entity\Site\Page;
- use EasyCorp\Bundle\EasyAdminBundle\Field\FormField;
- use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField;
- use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
- use Lc\SovBundle\Controller\AbstractAdminController as AbstractCrudController;
- use Lc\SovBundle\Field\CKEditorField;
- use Lc\SovBundle\Field\FileManagerField;
- use Lc\SovBundle\Field\GalleryManagerField;
- use Lc\SovBundle\Field\StatusField;
- use Lc\SovBundle\Repository\RepositoryQueryInterface;
-
- class PageCrudController extends AbstractCrudController
- {
- public static function getEntityFqcn(): string
- {
- return Page::class;
- }
-
- public function getRepositoryQuery(): RepositoryQueryInterface
- {
- return $this->getPageContainer()->getRepositoryQuery();
- }
-
- public function configureFields(string $pageName): iterable
- {
- $panel = parent::configureFields($pageName);
-
- return array_merge(
- [
- FormField::addPanel('general'),
- TextField::new('title'),
- NumberField::new('position')->hideOnForm(),
- CKEditorField::new('description'),
- FileManagerField::new('file'),
- StatusField::new('status'),
- FormField::addPanel('gallery'),
- GalleryManagerField::new('gallery')
- ],
- $panel
- );
- }
-
-
- }
|