src/Controller/Admin/MainController.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Admin;
  3. use App\Repository\JobAdRepository;
  4. use Symfony\Component\HttpFoundation\Request;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  8. class MainController extends AbstractController
  9. {
  10.     /**
  11.      * @Route("/admin", name="admin_home")
  12.      */
  13.     public function index(JobAdRepository $repository): Response
  14.     {
  15.         $JobsLastPending $repository->findByStatus(2,['id'=>'DESC'],5);
  16.         $JobsLastPublished $repository->findByStatus(9,['id'=>'DESC'],5);
  17.         return $this->render('_admin/home.html.twig', [
  18.             'JobsLastPending' => $JobsLastPending,
  19.             'JobsLastPublished' => $JobsLastPublished
  20.         ]);
  21.     }
  22. }