<?php
namespace App\Controller;
use App\Repository\ChannelRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
class UserController extends AbstractController
{
/**
* @Route("/user", name="user")
* @IsGranted("ROLE_USER")
*/
public function index(ChannelRepository $repository): Response
{
return $this->render('user/index.html.twig', [
'channels' => $this->getUser() ? $this->getUser()->getChannels() : [],
]);
}
}