src/Flexy/FrontBundle/Themes/IlaveU/Controller/PagesController.php line 20
<?php
namespace App\Flexy\FrontBundle\Themes\IlaveU\Controller;
use App\Flexy\FrontBundle\Repository\PageRepository;
use App\Flexy\ShopBundle\Repository\Customer\CustomerRepository;
use App\Flexy\ShopBundle\Repository\Order\OrderRepository;
use App\Flexy\ShopBundle\Repository\Product\ProductRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
#[Route('/{_locale}/pages')]
class PagesController extends AbstractController
{
#[Route('/{slug}', name: 'single_page')]
public function singlePage($slug,PageRepository $pageRepository): Response
{
return $this->render('@Flexy/FrontBundle/Themes/IlaveU/templates/pages/singlePage.html.twig',["page"=>$pageRepository->findOneBy(["slug"=>$slug])]);
}
#[Route('/about-us', name: 'about_us')]
public function about_us(ProductRepository $productRepository): Response
{
return $this->render('@Flexy/FrontBundle/Themes/IlaveU/templates/pages/about-us.html.twig');
}
#[Route('/contact', name: 'front_contact')]
public function contact(ProductRepository $productRepository): Response
{
return $this->render('@Flexy/FrontBundle/Themes/IlaveU/templates/home/contact.html.twig', [
'products' => $productRepository->findAll(),
]);
}
/** Test Mail Action */
#[Route('/mail/{slug}', name: 'single_page_mail')]
public function singlePageMail($slug,PageRepository $pageRepository,CustomerRepository $customerRepository,OrderRepository $orderRepository): Response
{
$customer = $customerRepository->find(5);
$order = $orderRepository->find(618);
return $this->render('@Flexy/FrontBundle/Themes/IlaveU/templates/pages/mailPage.html.twig',["page"=>$pageRepository->findOneBy(["slug"=>$slug]),"entity"=>$order]);
}
}