src/Controller/DashboardController.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Entity\Customer;
  4. use Doctrine\ORM\EntityManagerInterface;
  5. use Symfony\Component\HttpFoundation\Request;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. use Symfony\Component\Security\Core\Security;
  8. class DashboardController extends AdminController
  9. {
  10.     /**
  11.      * @Route("/admin/dashboard", name="user_dashboard")
  12.      */
  13.     public function userDashboard(Request $request)
  14.     {
  15.         return $this->render('admin/dashboard.html.twig', [
  16.             'entity' => $this->security->getUser(),
  17.             'users' => count($this->get('doctrine')->getRepository(Customer::class)->findAll())
  18.         ]);
  19.     }
  20. }