src/Controller/Out/HomepageController.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Out;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\HttpFoundation\Cookie;
  5. use Symfony\Component\HttpFoundation\Request;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. use Symfony\Component\HttpFoundation\Response;
  8. class HomepageController extends AbstractController
  9. {
  10.     /**
  11.      * @param Request $request
  12.      * @return Response
  13.      * @Route("/", name="public.homepage")
  14.      */
  15.     public function index(Request $request): Response
  16.     {
  17.         $data['title'] = 'تبلیغات در سفرمارکت';
  18.         $data['css'] = ['asset/css/homepage.css'];
  19.         $response $this->render('out/homepage.twig'$data);
  20.         /** Set return URL */
  21.         $response->headers->setCookie(Cookie::create('returnURL')->withValue($_ENV['BASE_URL'].'panel')->withExpires(time() + 86400)->withDomain('safarmarket.com'));
  22.         //send view to browser
  23.         return $response;
  24.     }
  25. }