yield MenuItem::linkToCrud('page', 'far fa-copy', Page::class); | yield MenuItem::linkToCrud('page', 'far fa-copy', Page::class); | ||||
yield MenuItem::subMenu('user', 'far fa-user')->setSubItems( | yield MenuItem::subMenu('user', 'far fa-user')->setSubItems( | ||||
[ | [ | ||||
MenuItem::linkToCrud('user_index', '', User::class), | |||||
MenuItem::linkToCrud('user_merchant_index', '', UserMerchant::class), | MenuItem::linkToCrud('user_merchant_index', '', UserMerchant::class), | ||||
] | ] | ||||
); | ); |
namespace App\Controller\Merchant; | namespace App\Controller\Merchant; | ||||
use App\Entity\Merchant\Merchant; | use App\Entity\Merchant\Merchant; | ||||
use App\Entity\Section\Section; | |||||
use App\Entity\Site\Page; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Field\FormField; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | |||||
use Lc\SovBundle\Controller\AbstractAdminController; | |||||
use Lc\SovBundle\Field\BooleanField; | |||||
use Lc\SovBundle\Field\CKEditorField; | |||||
use Lc\SovBundle\Field\StatusField; | |||||
use Lc\CaracoleBundle\Controller\Merchant\MerchantAdminController as CaracMerchantAdminController; | |||||
class MerchantAdminController extends AbstractAdminController | |||||
class MerchantAdminController extends CaracMerchantAdminController | |||||
{ | { | ||||
public static function getEntityFqcn(): string | public static function getEntityFqcn(): string | ||||
{ | { | ||||
return Merchant::class; | return Merchant::class; | ||||
} | } | ||||
public function configureFields(string $pageName): iterable | |||||
{ | |||||
$panel = parent::configureFields($pageName); | |||||
return array_merge( | |||||
[ | |||||
FormField::addPanel('general'), | |||||
TextField::new('title'), | |||||
NumberField::new('position') | |||||
->hideOnForm() | |||||
->hideOnIndex(), | |||||
CKEditorField::new('description') | |||||
->hideOnIndex(), | |||||
AssociationField::new('taxRate') | |||||
->setRequired(true) | |||||
->hideOnIndex(), | |||||
StatusField::new('status'), | |||||
], | |||||
$panel | |||||
); | |||||
} | |||||
} | } |
namespace App\Controller\Section; | namespace App\Controller\Section; | ||||
use App\Entity\Section\Section; | use App\Entity\Section\Section; | ||||
use App\Entity\Site\Page; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Field\ChoiceField; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Field\FormField; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | |||||
use Lc\CaracoleBundle\Controller\AbstractAdminController; | |||||
use Lc\SovBundle\Field\BooleanField; | |||||
use Lc\SovBundle\Field\CKEditorField; | |||||
use Lc\SovBundle\Field\StatusField; | |||||
use Lc\CaracoleBundle\Controller\Section\SectionAdminController as CaracSectionAdminController; | |||||
class SectionAdminController extends AbstractAdminController | |||||
class SectionAdminController extends CaracSectionAdminController | |||||
{ | { | ||||
public static function getEntityFqcn(): string | public static function getEntityFqcn(): string | ||||
{ | { | ||||
return Section::class; | return Section::class; | ||||
} | } | ||||
public function configureFields(string $pageName): iterable | |||||
{ | |||||
$panel = parent::configureFields($pageName); | |||||
return array_merge( | |||||
[ | |||||
FormField::addPanel('general'), | |||||
TextField::new('title'), | |||||
//AssociationField::new('merchant'), | |||||
ChoiceField::new('cycle') | |||||
->setRequired(true) | |||||
->setChoices( | |||||
[ | |||||
'Jour' => Section::CYCLE_DAY, | |||||
'Semaine' => Section::CYCLE_WEEK, | |||||
'Mois' => Section::CYCLE_MONTH, | |||||
'Année' => Section::CYCLE_YEAR, | |||||
] | |||||
), | |||||
TextField::new('color') | |||||
->setRequired(true) | |||||
->hideOnIndex(), | |||||
NumberField::new('position') | |||||
->hideOnForm() | |||||
->hideOnIndex(), | |||||
CKEditorField::new('description') | |||||
->hideOnIndex(), | |||||
StatusField::new('status'), | |||||
BooleanField::new('isDefault', 'Section par défaut'), | |||||
], | |||||
$panel | |||||
); | |||||
} | |||||
} | } |
use EasyCorp\Bundle\EasyAdminBundle\Field\FormField; | use EasyCorp\Bundle\EasyAdminBundle\Field\FormField; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField; | use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | ||||
use Lc\CaracoleBundle\Controller\AbstractAdminController; | |||||
use Lc\CaracoleBundle\Controller\AdminControllerTrait; | |||||
use Lc\SovBundle\Controller\AbstractAdminController; | |||||
use Lc\SovBundle\Field\CKEditorField; | use Lc\SovBundle\Field\CKEditorField; | ||||
use Lc\SovBundle\Field\ImageManagerField; | use Lc\SovBundle\Field\ImageManagerField; | ||||
use Lc\SovBundle\Field\StatusField; | use Lc\SovBundle\Field\StatusField; | ||||
use Lc\SovBundle\Form\Common\FileManagerType; | |||||
class PageAdminController extends AbstractAdminController | class PageAdminController extends AbstractAdminController | ||||
{ | { | ||||
use AdminControllerTrait; | |||||
public static function getEntityFqcn(): string | public static function getEntityFqcn(): string | ||||
{ | { | ||||
return Page::class; | return Page::class; |
<?php | |||||
namespace App\Controller\User; | |||||
use App\Entity\User\User; | |||||
use Lc\CaracoleBundle\Controller\User\UserAdminController as CaracUserAdminController; | |||||
class UserAdminController extends CaracUserAdminController | |||||
{ | |||||
public static function getEntityFqcn(): string | |||||
{ | |||||
return User::class; | |||||
} | |||||
} |