コード例 #1
0
 public function eshopDetailAction(Request $request)
 {
     /** @var Eshop $eshop */
     $eshop = $this->eshopRepository->findOne([EshopMeta::SLUG => $request->attributes->get("eshop")]);
     $category = null;
     if ($request->attributes->has("category")) {
         /** @var Category $category */
         $category = $this->categoryRepository->findOneById($request->attributes->get("category"));
     }
     return $this->render("CC15Bundle:Eshop:eshopDetail.html.twig", ["eshop" => $eshop, "category" => $category, "categories" => $this->categoryRepository->findCategories($eshop, $category), "products" => $this->listingService->findProducts(ListingFilter::create()->setEshop($eshop)->setCategory($category))]);
 }
コード例 #2
0
 public function homepageAction()
 {
     return $this->render("CC15Bundle:Homepage:homepage.html.twig", ["eshops" => $this->eshopRepository->findEshopsForHomepage(), "products" => $this->listingService->findProducts(ListingFilter::create())]);
 }
コード例 #3
0
 public function searchAction(Request $request)
 {
     $q = $request->query->get("q");
     return $this->render("CC15Bundle:Search:search.html.twig", ["q" => $q, "products" => $this->listingService->findProducts(ListingFilter::create()->setQ($q))]);
 }