src/Controller/ECommerce/App/ProductManufacturerController.php line 32

Open in your IDE?
  1. <?php
  2. namespace App\Controller\ECommerce\App;
  3. use App\Entity\ECommerce\ProductManufacturer;
  4. use Knp\Component\Pager\PaginatorInterface;
  5. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;
  6. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  7. use Symfony\Component\HttpFoundation\Request;
  8. use Symfony\Component\HttpFoundation\Response;
  9. use Symfony\Component\Routing\Annotation\Route;
  10. /**
  11. * ProductManufacturer controller.
  12. *
  13. * @package App\Controller\ECommerce\App
  14. *
  15. * @Route("/{_locale}/product_manufacturer", requirements={"_locale": "\w{2}"})
  16. */
  17. class ProductManufacturerController extends AbstractController
  18. {
  19. /**
  20. * Lists all productGroup entities.
  21. *
  22. * @Route("/index", name="mdl_app_product_manufacturer_index")
  23. *
  24. * @Cache(expires="+2 days", public=true)
  25. */
  26. public function indexAction(Request $request, PaginatorInterface $paginator): Response
  27. {
  28. $productGroups = $paginator->paginate(
  29. $this->getDoctrine()->getRepository(ProductManufacturer::class)->createPublicQueryBuilder(),
  30. $request->query->getInt('page', 1),
  31. $request->query->getInt('limit', 8)
  32. );
  33. return $this->render('ECommerce/App/Product/sidebar/Manufacturer/index.html.twig', [
  34. 'productGroups' => $productGroups,
  35. ]);
  36. }
  37. }