<?php
namespace App\Controller\Frontend;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Doctrine\ORM\EntityManagerInterface;
use App\Service\TextHelper;
use App\Entity\Section;
class BuyticketController extends AbstractController {
public function __construct() {
// echo 'We can use __contruct<br />';
}
/**
* @Route(
* {
* "es" : "{_locale}/entrada",
* "ca" : "{_locale}/entrada",
* "en" : "{_locale}/tickets",
* }, name="buyticket",
* requirements={
* "_locale": "es|ca|en",
* "_format" : "html"
* }
* )
*/
public function index(Request $request, TextHelper $textHelper) {
$oneSection = $this->getDoctrine()->getRepository(Section::Class)->findOneBy(['code' => 'buyticket']);
$text = ($textHelper->getBySection($oneSection)) ? $textHelper->getBySection($oneSection) : [];
return $this->render('Frontend/buyticket/buyticket.html.twig',['text' => $text, 'oneSection' => $oneSection]);
}
}