src/Controller/Admin/Home/HomeController.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Admin\Home;
  3. //use Symfony\Component\HttpFoundation\Response;
  4. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  5. use App\Entity\Customer\Customer;
  6. use App\Entity\Invoice\Invoice;
  7. class HomeController extends AbstractController
  8. {
  9.     public function index()
  10.     {
  11.         $em $this->getDoctrine()->getManager();
  12.         $customers $em->getRepository(Customer::class)->findBy([], ['id'=>'DESC'], 50);
  13.         $invoices $em->getRepository(Invoice::class)->findBy([], ['id'=>'DESC'], 50);
  14.         return $this->render('admin/home/index.html.twig', [
  15.             'customers' => $customers,
  16.             'invoices' => $invoices
  17.         ]);
  18.     }
  19. }