src/Flexy/FrontBundle/Themes/IlaveU/Controller/PagesController.php line 20

  1. <?php
  2. namespace App\Flexy\FrontBundle\Themes\IlaveU\Controller;
  3. use App\Flexy\FrontBundle\Repository\PageRepository;
  4. use App\Flexy\ShopBundle\Repository\Customer\CustomerRepository;
  5. use App\Flexy\ShopBundle\Repository\Order\OrderRepository;
  6. use App\Flexy\ShopBundle\Repository\Product\ProductRepository;
  7. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  8. use Symfony\Component\HttpFoundation\Response;
  9. use Symfony\Component\Routing\Annotation\Route;
  10. #[Route('/{_locale}/pages')]
  11. class PagesController extends AbstractController
  12. {
  13.     #[Route('/{slug}'name'single_page')]
  14.     public function singlePage($slug,PageRepository $pageRepository): Response
  15.     {
  16.         return $this->render('@Flexy/FrontBundle/Themes/IlaveU/templates/pages/singlePage.html.twig',["page"=>$pageRepository->findOneBy(["slug"=>$slug])]);
  17.     }
  18.     #[Route('/about-us'name'about_us')]
  19.     public function about_us(ProductRepository $productRepository): Response
  20.     {
  21.         return $this->render('@Flexy/FrontBundle/Themes/IlaveU/templates/pages/about-us.html.twig');
  22.     }
  23.     #[Route('/contact'name'front_contact')]
  24.     public function contact(ProductRepository $productRepository): Response
  25.     {
  26.         return $this->render('@Flexy/FrontBundle/Themes/IlaveU/templates/home/contact.html.twig', [
  27.             'products' => $productRepository->findAll(),
  28.         ]);
  29.     }
  30.     /** Test Mail Action */
  31.     #[Route('/mail/{slug}'name'single_page_mail')]
  32.     
  33.     public function singlePageMail($slug,PageRepository $pageRepository,CustomerRepository $customerRepository,OrderRepository $orderRepository): Response
  34.     {
  35.         $customer $customerRepository->find(5);
  36.         $order $orderRepository->find(618);
  37.         
  38.         return $this->render('@Flexy/FrontBundle/Themes/IlaveU/templates/pages/mailPage.html.twig',["page"=>$pageRepository->findOneBy(["slug"=>$slug]),"entity"=>$order]);
  39.     }
  40.     
  41. }