E
E
Eobard Thawne2019-06-05 12:14:22
symfony
Eobard Thawne, 2019-06-05 12:14:22

How to paginate data in Symfony?

Good afternoon, I want to make paginated data output on the page. Made a request.

$em = $this->getDoctrine()->getManager();
      $data = $em->getRepository(Buildingimage::class)->findAll();

      $query = $em->createQuery(
        'SELECT
          p.id, p.logourl, p.name
          FROM
          App\Entity\Builders p
        '
      )->setMaxResults(10)->setFirstResult(0)->getResult();

How to break it all into pages?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Flying, 2019-06-05
@vexgg

Doctrine provides built- in pagination capabilities.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question