31 lines
829 B
PHP
31 lines
829 B
PHP
<?php
|
|
|
|
namespace App\Controller\Admin;
|
|
|
|
use App\Entity\ConfigVariable;
|
|
use App\Enum\ConfigSectionType;
|
|
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
|
|
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
|
|
use EasyCorp\Bundle\EasyAdminBundle\Field\ChoiceField;
|
|
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
|
|
|
|
class ConfigVariableCrudController extends AbstractCrudController
|
|
{
|
|
public static function getEntityFqcn(): string
|
|
{
|
|
return ConfigVariable::class;
|
|
}
|
|
|
|
public function configureCrud(Crud $crud): Crud
|
|
{
|
|
return $crud;
|
|
}
|
|
|
|
public function configureFields(string $pageName): iterable
|
|
{
|
|
yield ChoiceField::new ('section')->setChoices(ConfigSectionType::cases());
|
|
yield TextField::new ('key');
|
|
yield TextField::new ('value');
|
|
}
|
|
}
|