src/Controller/DashboardController.php line 28

  1. <?php
  2. /*
  3.  * This file is part of the Pellipop project.
  4.  *
  5.  * (c) Mobizel
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. declare(strict_types=1);
  11. namespace App\Controller;
  12. use Monofony\Contracts\Admin\Dashboard\DashboardStatisticsProviderInterface;
  13. use Symfony\Component\HttpFoundation\Response;
  14. use Twig\Environment;
  15. final class DashboardController
  16. {
  17.     public function __construct(
  18.         private DashboardStatisticsProviderInterface $statisticsProvider,
  19.         private Environment $twig,
  20.     ) {
  21.     }
  22.     public function indexAction(): Response
  23.     {
  24.         $statistics $this->statisticsProvider->getStatistics();
  25.         $content $this->twig->render('backend/index.html.twig', ['statistics' => $statistics]);
  26.         return new Response($content);
  27.     }
  28. }