選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

DashboardController.php 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. }