src/Controller/Front/FooterController.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Front;
  3. use App\Entity\{PartnerArticleContactPage};
  4. use App\Service\AccessClientService;
  5. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  6. use Symfony\Component\HttpFoundation\Request;
  7. use Symfony\Component\HttpFoundation\Response;
  8. use Symfony\Component\Routing\Annotation\Route;
  9. use Doctrine\ORM\EntityManagerInterface;
  10. class FooterController extends AbstractController
  11. {
  12.     public function partners(EntityManagerInterface $entityManager): Response
  13.     {
  14.         $partners $entityManager->getRepository(Partner::class)->findBy([], ['id' => 'ASC']);
  15.         return $this->render('front/footer/partner.html.twig', [
  16.             'partners' => $partners
  17.         ]);
  18.     }
  19.     public function articles(EntityManagerInterface $entityManager): Response
  20.     {
  21.         $lastArticles $entityManager->getRepository(Article::class)->findBy(['status' => true], ['id' => 'DESC'], 30);
  22.         return $this->render('front/footer/last_article.html.twig', [
  23.             'lastArticles' => $lastArticles
  24.         ]);
  25.     }
  26.     public function contact(EntityManagerInterface $entityManager): Response
  27.     {
  28.         $contact $entityManager->getRepository(ContactPage::class)->findOneBy([], ['id' => 'DESC']);
  29.         return $this->render('front/footer/social_network.html.twig', [
  30.             'contact' => $contact
  31.         ]);
  32.     }
  33. }