<?php
namespace App\Controller\Site;
use App\Entity\Player;
use App\Repository\PlayerRepository;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class DefaultController extends AbstractSiteController {
/**
* @Route("/")
* @Cache(mustRevalidate=true)
*/
public function index() {
/* @var $response Response */
$response = $this->render(
'site/index.html.twig',
);
return $response;
}
/**
* @Cache(mustRevalidate=true)
* @Route("/fakeplayer")
*/
public function player(Request $r, PlayerRepository $repo) {
$slug = $r->get('p');
if(!$slug) throw $this->createAccessDeniedException();
$voucher = $r->get('v');
/* @var $response Response */
$response = $this->render(
'site/fakeplayer.html.twig',
[
'slug' => $slug,
'voucher' => $voucher,
]
);
return $response;
}
}