Aplicación para gestionar el WiFi y punto de luz en puertos.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.4 KiB

  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Admin;
  4. use Sonata\AdminBundle\Admin\AbstractAdmin;
  5. use Sonata\AdminBundle\Datagrid\DatagridMapper;
  6. use Sonata\AdminBundle\Datagrid\ListMapper;
  7. use Sonata\AdminBundle\Form\FormMapper;
  8. use Sonata\AdminBundle\Show\ShowMapper;
  9. final class MenuAdmin extends AbstractAdmin
  10. {
  11. protected function configureDatagridFilters(DatagridMapper $filter): void
  12. {
  13. $filter
  14. ->add('id')
  15. ->add('alias')
  16. ->add('titulo')
  17. ->add('descripcion')
  18. ;
  19. }
  20. protected function configureListFields(ListMapper $list): void
  21. {
  22. $list
  23. ->add('id')
  24. ->add('alias')
  25. ->add('titulo')
  26. ->add('descripcion')
  27. ->add(ListMapper::NAME_ACTIONS, null, [
  28. 'actions' => [
  29. 'show' => [],
  30. 'edit' => [],
  31. 'delete' => [],
  32. ],
  33. ]);
  34. }
  35. protected function configureFormFields(FormMapper $form): void
  36. {
  37. $form
  38. ->add('id')
  39. ->add('alias')
  40. ->add('titulo')
  41. ->add('descripcion')
  42. ;
  43. }
  44. protected function configureShowFields(ShowMapper $show): void
  45. {
  46. $show
  47. ->add('id')
  48. ->add('alias')
  49. ->add('titulo')
  50. ->add('descripcion')
  51. ;
  52. }
  53. }