Le 01/04/2014 08:18, paul kendal a écrit :
Hi everyone
i am trying to use Doctrine 2 with zend 2 and want to add a pagination
module. the pagination will have to take into account the fetching of
a lot of collections.
I understand that the basic Doctrine 2 Pagination is not sufficient
for this purpose and that two alternative modules were recommended.
A: Pagerfanta <https://github.com/whiteoctober/pagerfanta>
B: DoctrineExtensions <https://github.com/beberlei/DoctrineExtensions>
**
However, i seem to have problems with both modules.
I tried to upload the Pagerfanta when i got the following error message:
Uncaught exception 'Zend\ModuleManager\Exception\RuntimeException'
with message 'Module (Pagerfanta) could not be initialized.
I also looked at the *DoctrineExtensions *but *its no longer being
maintained and also, there are no clear instruction on how to use it.
For example, its say; to include the doctirne extention do this:
*
*$classLoader = new \Doctrine\Common\ClassLoader('DoctrineExtensions',
"/path/to/extensions");
$classLoader->register**();*
but i am unclear where i will do this.
i would really appreciate some advise regarding pagination for Doctrine2 and
Zend 2
the DoctrineExtensions pagination code does nothing more than the code
available in Doctrine itself. the difference is that it does it for
Doctrine 2.1 (it was the prototype for the pagination logic to make it
reliable without moving it to core).
If you need more advanced pagination, you have 2 choices (at least):
- using pagerfanta
- using a Doctrine ORM adapter for Zend Paginator, which would use the
ORM pagination internally. The adapter is provided by the
DoctrineORMModule:
https://github.com/doctrine/DoctrineORMModule/blob/master/src/DoctrineORMModule/Paginator/Adapter/DoctrinePaginator.php
Your issue with Pagerfanta is that you try to register it as a ZF module
while it is not a ZF module. It is a standalone library. To get help on
registering services for libraries that don't provide a ZF integration
out of the box, contact the ZF community rather than the
--
Christophe | Stof
--
You received this message because you are subscribed to the Google Groups
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.