Skip to content

Instantly share code, notes, and snippets.

@andreybolonin
Created March 14, 2021 07:13
Show Gist options
  • Save andreybolonin/648634ae2d64073c1a8602c171ccc7f7 to your computer and use it in GitHub Desktop.
Save andreybolonin/648634ae2d64073c1a8602c171ccc7f7 to your computer and use it in GitHub Desktop.
ContactController.php
<?php
$query = $this->getDoctrine()
->getRepository(Contact::class)
->createQueryBuilder('c');
$contacts = $paginator->paginate(
$query, /* query NOT result */
$request->query->getInt('page', 1)/*page number*/ ,
$request->getSession()->get('items', $request->query->get('items', 100))
);
return $this->render('contact/index.html.twig', [
'contacts' => $contacts,
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment