|
- <?php
-
- namespace Lc\AdminBundle\Controller\Admin;
-
- use App\Entity\Page;
- use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
- use EasyCorp\Bundle\EasyAdminBundle\Config\Dashboard;
- use EasyCorp\Bundle\EasyAdminBundle\Config\MenuItem;
- use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractDashboardController;
- use Symfony\Component\HttpFoundation\Response;
- use Symfony\Component\Routing\Annotation\Route;
-
- class DashboardController extends AbstractDashboardController
- {
-
- public function index(): Response
- {
- return $this->render('@LcAdmin/dashboard.html.twig');
- }
-
- public function configureDashboard(): Dashboard
- {
- return Dashboard::new()
- // the name visible to end users
- ->setTitle('LA CLIC !')
- // you can include HTML contents too (e.g. to link to an image)
- ->setTitle('<img src="assets/img/laclic.png" width="100px">')
- // the path defined in this method is passed to the Twig asset() function
- ->setFaviconPath('favicon.svg')
- // the domain used by default is 'messages'
- ->setTranslationDomain('lcadmin');
- }
-
- public function configureCrud(): Crud
- {
- $crud = Crud::new();
- return $crud
- ->addFormTheme('@FOSCKEditor/Form/ckeditor_widget.html.twig');
- }
-
- public function configureMenuItems(): iterable
- {
- return [
- MenuItem::linkToDashboard('Tableau de bord', 'fa fa-home'),
- MenuItem::linkToCrud('Pages', 'fa fa-tags', Page::class),
-
-
- /*
- MenuItem::section('Blog'),
- MenuItem::linkToCrud('Categories', 'fa fa-tags', Category::class),
- MenuItem::linkToCrud('Blog Posts', 'fa fa-file-text', BlogPost::class),
-
- MenuItem::section('Users'),
- MenuItem::linkToCrud('Comments', 'fa fa-comment', Comment::class),
- MenuItem::linkToCrud('Users', 'fa fa-user', User::class),*/
-
- //MenuItem::linkToLogout('Déconnexion', 'fa fa-exit'),
- ];
- }
- }
|