您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

TaxRateAdminController.php 995B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace Lc\CaracoleBundle\Controller\Config;
  3. use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
  4. use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField;
  5. use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
  6. use Lc\CaracoleBundle\Container\Config\TaxRateContainer;
  7. use Lc\CaracoleBundle\Controller\AdminControllerTrait;
  8. use Lc\CaracoleBundle\Factory\Config\TaxRateFactory;
  9. use Lc\SovBundle\Controller\AbstractAdminController;
  10. abstract class TaxRateAdminController extends AbstractAdminController
  11. {
  12. use AdminControllerTrait;
  13. public function configureFields(string $pageName): iterable
  14. {
  15. return [
  16. TextField::new('title'),
  17. NumberField::new('value')
  18. ];
  19. }
  20. public function configureCrud(Crud $crud): Crud
  21. {
  22. return $crud->setSearchFields(['id', 'title', 'value']);
  23. }
  24. public function createEntity(string $entityFqcn)
  25. {
  26. return $this->get(TaxRateContainer::class)->getFactory()->create();
  27. }
  28. }