Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

61 line
2.3KB

  1. <?php
  2. namespace Lc\AdminBundle\Controller\Admin;
  3. use App\Entity\Page;
  4. use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
  5. use EasyCorp\Bundle\EasyAdminBundle\Config\Dashboard;
  6. use EasyCorp\Bundle\EasyAdminBundle\Config\MenuItem;
  7. use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractDashboardController;
  8. use Symfony\Component\HttpFoundation\Response;
  9. use Symfony\Component\Routing\Annotation\Route;
  10. class DashboardController extends AbstractDashboardController
  11. {
  12. public function index(): Response
  13. {
  14. return $this->render('@LcAdmin/dashboard.html.twig');
  15. }
  16. public function configureDashboard(): Dashboard
  17. {
  18. return Dashboard::new()
  19. // the name visible to end users
  20. ->setTitle('LA CLIC !')
  21. // you can include HTML contents too (e.g. to link to an image)
  22. ->setTitle('<img src="assets/img/laclic.png" width="100px">')
  23. // the path defined in this method is passed to the Twig asset() function
  24. ->setFaviconPath('favicon.svg')
  25. // the domain used by default is 'messages'
  26. ->setTranslationDomain('lcadmin');
  27. }
  28. public function configureCrud(): Crud
  29. {
  30. $crud = Crud::new();
  31. return $crud
  32. ->addFormTheme('@FOSCKEditor/Form/ckeditor_widget.html.twig');
  33. }
  34. public function configureMenuItems(): iterable
  35. {
  36. return [
  37. MenuItem::linkToDashboard('Tableau de bord', 'fa fa-home'),
  38. MenuItem::linkToCrud('Pages', 'fa fa-tags', Page::class),
  39. /*
  40. MenuItem::section('Blog'),
  41. MenuItem::linkToCrud('Categories', 'fa fa-tags', Category::class),
  42. MenuItem::linkToCrud('Blog Posts', 'fa fa-file-text', BlogPost::class),
  43. MenuItem::section('Users'),
  44. MenuItem::linkToCrud('Comments', 'fa fa-comment', Comment::class),
  45. MenuItem::linkToCrud('Users', 'fa fa-user', User::class),*/
  46. //MenuItem::linkToLogout('Déconnexion', 'fa fa-exit'),
  47. ];
  48. }
  49. }