src/Controller/PrivacyController.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Repository\CrossAppRepository;
  4. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  5. use Symfony\Component\HttpFoundation\Request;
  6. use Symfony\Component\HttpFoundation\Response;
  7. use Symfony\Component\Routing\Annotation\Route;
  8. class PrivacyController extends AbstractController
  9. {
  10.     /**
  11.      * @Route("/privacy", name="app.privacy")
  12.      */
  13.     public function privacy(Request $requestCrossAppRepository $crossAppRepository){
  14.         $package_name $request->get('pkg');
  15.         if ( ! $package_name )
  16.             return new Response('erreur'403);
  17.         $app $crossAppRepository->findOneBy(['app_package_name' => $package_name]);
  18.         if ( ! $app )
  19.             return new Response('erreur'403);
  20.         return $this->render('privacy/privacy.app.html.twig', ['app' => $app]);
  21.     }
  22. }