<?php
namespace App\Controller;
use App\Entity\AllTyre;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class StartController extends AbstractController
{
/**
* @Route("/", name="app_start")
*/
public function index(EntityManagerInterface $entityManager): Response
{
$product = $entityManager->getRepository(AllTyre::class)->findAll();
// if($this->getUser() != NULL){
// $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
// $user = $this->getUser();
// echo $user->getUsername();
// }
return $this->render('start/index.html.twig', [
'page_name' => 'Главная',
'product' => $product,
]);
}
}