<?php
namespace App\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class RobotsController extends BaseController
{
/**
* Used for SEO purposes
* @Route("/robots.txt", name="robots.robots_content", defaults={"_format"="txt"})
* @param string $siteBaseUrl
* @return Response
*/
public function robots(string $siteBaseUrl): Response
{
$response = new Response(
$this->renderView('robots/_robots.html.twig', [
'siteBaseUrl' => $siteBaseUrl,
]),
200
);
$response->headers->set('Content-Type', 'text/plain');
return $response;
}
}