src/Controller/ContentController.php line 158

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Google\Service\Games\CategoryListResponse;
  4. use Google\Service\ManufacturerCenter\ProductDetail;
  5. use Pimcore\Controller\FrontendController;
  6. use Pimcore\Model\DataObject;
  7. use Pimcore\Model\DataObject\Customers;
  8. use Pimcore\Model\DataObject\Manufacturers;
  9. use Pimcore\Model\DataObject\Orders;
  10. use Pimcore\Model\DataObject\Product;
  11. use Pimcore\Model\DataObject\Product\Listing as Productlist;
  12. use Pimcore\Model\DataObject\Orders\Listing as OrdersList;
  13. use Pimcore\Model\DataObject\Manufacturers\Listing as ManufacturersList;
  14. use Pimcore\Model\DataObject\Customers\Listing as CustomersList;
  15. use Pimcore\Model\DataObject\Category\Listing as CategoryList;
  16. use Knp\component\Pager\PaginatorInterface;
  17. use Symfony\Component\HttpFoundation\Request;
  18. use Symfony\Component\HttpFoundation\Response;
  19. use Symfony\Component\HttpFoundation\OutputTimestampResolver;
  20. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  21. class ContentController extends FrontendController
  22. {
  23.     /**
  24.      * @Template
  25.      */
  26.     public function defaultAction(Request $request)
  27.     {
  28.         return [];
  29.     }
  30.     public function productAction(Request $request\Knp\Component\Pager\PaginatorInterface $paginator)
  31.     {
  32.         $proList Product::getList([
  33.         ]);
  34.         $list = new Productlist();
  35.         $list->setOrderKey("name");
  36.         $list->setOrder("asc");
  37.         $paginator $paginator->paginate(
  38.             $proList,
  39.             $request->get('page'1),
  40.             20
  41.         );
  42. //        dd($paginator);
  43.         return $this->render('content/product.html.twig', ["proList" => $proList'paginator' => $paginator'predator' => $paginator->getPaginationData()]);
  44.     }
  45.     public function productdetailAction(Request $request)
  46.     {
  47.         $id $request->query->get('id');
  48.         $product Product::getByProduct_id($id)->getFieldCollections();
  49. //        dd($product);
  50. //        dd($product);
  51. //        dd($detail);
  52. //           $detail[] = $detail;
  53. //        $products_name = $request->get('product_name');
  54. //        $products_status = $request->get('products_status');
  55. //        $product_viewed = $request->get('products_viewed');
  56. //        $products_ordered = $request->get('products_ordered');
  57. //        $products_size = $request->get('products_size');
  58. //        return $this->redirectToRoute('product');
  59.         return $this->render('content/productdetail.html.twig', ['product' => $product]);
  60. //
  61.     }
  62.     public function ordersAction(Request $request\Knp\Component\Pager\PaginatorInterface $paginator)
  63.     {
  64.         $ordersList Orders::getList();
  65.         $list = new OrdersList();
  66.         $list->setOrderKey("orders_id");
  67.         $list->setOrder("asc");
  68.         $paginator $paginator->paginate(
  69.             $ordersList,
  70.             $request->get('page'1),
  71.             20
  72.         );
  73. //        dd($paginator);
  74.         return $this->render('content/orders.html.twig', ["ordersList" => $ordersList'paginator' => $paginator'predator' => $paginator->getPaginationData()]);
  75.     }
  76.     public function ordersdetailAction(Request $request)
  77.     {
  78.         return $this->render('content/ordersdetail.html.twig');
  79.     }
  80.     public function manufacturersAction(Request $request\Knp\Component\Pager\PaginatorInterface $paginator)
  81.     {
  82.         $manufacturersList Manufacturers::getList();
  83.         $list = new ManufacturersList();
  84.         $list->setOrderKey("orders_id");
  85.         $list->setOrder("asc");
  86.         $paginator $paginator->paginate(
  87.             $manufacturersList,
  88.             $request->get('page'1),
  89.             20
  90.         );
  91.         return $this->render('content/manufacturers.html.twig', ["manufacturersList" => $manufacturersList'paginator' => $paginator'predator' => $paginator->getPaginationData()]);
  92.     }
  93.     public function manufacturersdetailAction(Request $request)
  94.     {
  95.         return $this->render('content/manufacturersdetail.html.twig');
  96.     }
  97.     public function customersAction(Request $request\Knp\Component\Pager\PaginatorInterface $paginator)
  98.     {
  99.         $customersList Customers::getList();
  100.         $list = new CustomersList();
  101.         $list->setOrderKey("orders_id");
  102.         $list->setOrder("asc");
  103.         $paginator $paginator->paginate(
  104.             $customersList,
  105.             $request->get('page'1),
  106.             20
  107.         );
  108.         return $this->render('content/customers.html.twig', ["customersList" => $customersList'paginator' => $paginator'predator' => $paginator->getPaginationData()]);
  109.     }
  110.     public function customersdetailAction(Request $request)
  111.     {
  112.         return $this->render('content/customersdetail.html.twig');
  113.     }
  114.     public function categoryAction(Request $request\Knp\Component\Pager\PaginatorInterface $paginator)
  115.     {
  116.         $categoryList DataObject\Category::getList();
  117.         $list = new CategoryList();
  118.         $list->setOrderKey("orders_id");
  119.         $list->setOrder("asc");
  120.         $paginator $paginator->paginate(
  121.             $categoryList,
  122.             $request->get('page'1),
  123.             20
  124.         );
  125.         return $this->render('content/category.html.twig', ["categoryList" => $categoryList'paginator' => $paginator'predator' => $paginator->getPaginationData()]);
  126.     }
  127.     public function categorydetailAction(Request $request)
  128.     {
  129.         return $this->render('content/categorydetail.html.twig');
  130.     }
  131. }