<?php

namespace App\Controller;

use App\Entity\Site\Page;
use Lc\SovBundle\Doctrine\EntityManager;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;


class DefaultController extends AbstractController
{
        protected $em;
        protected $mailer;

        public function __construct(EntityManager $em)
        {
                $this->em = $em;
        }

        public function index(): Response
        {
                $pageRepository = $this->em->getRepository(Page::class);
                $pages = $pageRepository->findAll();

                return $this->render('index.html.twig', [
                        'pages' => $pages
                ]);
        }
}
