src/Controller/Pack/NotifController.php line 26

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Pack;
  3. use App\Entity\PfoNotif;
  4. use App\Repository\PfoNotifRepository;
  5. use Symfony\Component\HttpFoundation\Request;
  6. use Symfony\Component\HttpFoundation\Response;
  7. use Symfony\Component\Routing\Annotation\Route;
  8. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  9. class NotifController extends AbstractController
  10. {
  11.     /**
  12.      * @Route("/pack/notif/view/{id}", name="pack_notif_view")
  13.      */
  14.     public function view(PfoNotif $pfoNotif) : Response
  15.     {
  16.         return $this->json($pfoNotif200, [] , ['groups' => ['show_notif']]);
  17.     }
  18.     /**
  19.      * @Route("/", name="jobs")
  20.      *
  21.      */
  22.     public function jobs(PfoNotifRepository $pfoNotifRepository) : Response
  23.     {
  24.         $pfoNotifs $pfoNotifRepository->findSort('pf.created''DESC');
  25.         return $this->render('jobs/index.html.twig', [
  26.             'list' => $pfoNotifs,
  27.         ]);
  28.     }
  29.     /**
  30.      * @Route("/pack/notif/tri/all", name="jobs_tri")
  31.      */
  32.     public function tri(Request $requestPfoNotifRepository $pfoNotifRepository)
  33.     {
  34.         $order = ($request->get('order') != null) ? $request->get('order') : 'id';
  35.         $dir = ($request->get('dir') != null) ? $request->get('dir') : 'desc';
  36.         $pfoNotifs $pfoNotifRepository->findSort($order$dir);
  37.         return $this->render('jobs/lines.html.twig', [
  38.             'list' => $pfoNotifs,
  39.         ]);
  40.     }
  41. }