search

Home  >  Q&A  >  body text

Does symfony2 provide paging components?

RT, do you need to expand it yourself?
If you need to extend it, which file do you usually put it in? Are there any regulations?

天蓬老师天蓬老师2856 days ago407

reply all(1)I'll reply

  • ringa_lee

    ringa_lee2017-05-16 16:47:24

    There are two third-party bundles:

    • https://github.com/KnpLabs/KnpPaginatorBundle
    • https://github.com/whiteoctober/WhiteOctoberPagerfantaBundle

    All of the above can be implemented with adapter interfaces, which can support different data source types;

    If you want to extend it yourself, take Doctrine as an example. You can make a base class for Repository, implement the paging logic you need in this base class, and configure the Models with specific implementations inherited from this Repository. As for the placement location of the Repository, it can be placed under the Entity (Doctrine ORM) or Document (MongoDB) folder of the Bundle

    reply
    0
  • Cancelreply