嗨任何人都可以让我知道如何在Symfony2.4.2中使用分页,而我正在使用MongoDB和symfony。我找不到任何好的方法,就像在Cakephp中我们可以使用它的内置组件进行分页。
以下是我在控制器中的查询,列出了Mongodb的所有任务。
$documents = $dm->getRepository('WorkOrganisationBundle:Tasks')->findAll();
$counttasks = count($documents);
return $this->render('WorkOrganisationBundle:Tasks:index.html.twig', array(
'documents' => $documents
));
谢谢你提前