<?php
namespace App\Controller;
use App\Repository\LabelRepository;
use App\Repository\NewsletterRepository;
use App\Repository\SettingRepository;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
class NewsletterController extends AbstractController
{
/**
* @Route("/newsletter", name="app_newsletter", methods={"GET"})
*/
public function newsletter(
SettingRepository $settingRepository,
LabelRepository $labelRepository,
NewsletterRepository $newsletterRepository
): Response {
return $this->render('newsletter/index.html.twig', [
'settings' => $settingRepository->findAll(),
'labels' => $labelRepository->findAll(),
'newsletters' => $newsletterRepository->findBy(['isEnabled' => true], ['id' => 'DESC']),
'pageTitle' => 'newsletter'
]);
}
}