<?php
namespace MLDev\SeoSiteBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use MLDev\SeoSiteBundle\Service\SiteManager;
class RobotsController extends AbstractController
{
/**
* @Route("/robots.txt", name="mldev-front-robots")
*/
public function robotsAction(SiteManager $site)
{
$response = new Response(
$site->getCurrentSeoSite()->getRobots()
);
$response->headers->set('Content-Type', 'text/plain');
return $response;
}
}