<?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\Admin\AbstractCrudController;
use Lc\SovBundle\Field\BooleanField;
use Lc\SovBundle\Field\CKEditorField;
use Lc\SovBundle\Field\StatusField;

class PageCrudController extends AbstractCrudController
{
    public static function getEntityFqcn(): string
    {
        return Page::class;
    }

    public function configureFields(string $pageName): iterable
    {
        $panel = parent::configureFields($pageName);

        return array_merge(
                [
                        FormField::addPanel('Général'),
                    //->setCustomOption('template', '@LcSov/adminlte/crud/_test.html.twig')
                        TextField::new('title'),
                        NumberField::new('position')->hideOnForm(),
                        //BooleanField::new('titlefefe')->setFormTypeOption('mapped', false)->setFormTypeOption('required', true),
                        StatusField::new('status'),
                        CKEditorField::new('description'),

                ],
                $panel
        );
    }


}
