<?php
namespace App\Controller\Out;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Cookie;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\Response;
class HomepageController extends AbstractController
{
/**
* @param Request $request
* @return Response
* @Route("/", name="public.homepage")
*/
public function index(Request $request): Response
{
$data['title'] = 'تبلیغات در سفرمارکت';
$data['css'] = ['asset/css/homepage.css'];
$response = $this->render('out/homepage.twig', $data);
/** Set return URL */
$response->headers->setCookie(Cookie::create('returnURL')->withValue($_ENV['BASE_URL'].'panel')->withExpires(time() + 86400)->withDomain('safarmarket.com'));
//send view to browser
return $response;
}
}