|
- <?php
-
- namespace Lc\CaracoleBundle\Controller\Config;
-
- use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
- use EasyCorp\Bundle\EasyAdminBundle\Field\IntegerField;
- use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField;
- use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
- use Lc\CaracoleBundle\Controller\AbstractAdminController;
-
- abstract class TaxRateAdminController extends AbstractAdminController
- {
-
- public function configureCrud(Crud $crud): Crud
- {
- return $crud->setSearchFields(['id', 'title', 'value']);
- }
-
- public function configureFields(string $pageName): iterable
- {
- $id = IntegerField::new('id', 'ID');
- $title = TextField::new('title');
- $value = NumberField::new('value');
-
- if (Crud::PAGE_INDEX === $pageName) {
- return [$id, $title, $value];
- } elseif (Crud::PAGE_DETAIL === $pageName) {
- return [$id, $title, $value];
- } elseif (Crud::PAGE_NEW === $pageName) {
- return [$title, $value];
- } elseif (Crud::PAGE_EDIT === $pageName) {
- return [$title, $value];
- }
- }
- }
|