Giter Site home page Giter Site logo

Comments (10)

ErikTrapman avatar ErikTrapman commented on June 29, 2024

I use KNP instead of PagerFanta (just a habit, no real reason) and i would be happy with KNP support. It would mean your listAction would look like this:

public function indexAction(PaginationInterface $paginator)

and the PaginatorAnnotationResolver would look sth like this:

public function decidePaginatorFormat(
        Paginator $paginator,
        $parameterType,
        $limitPerPage,
        $page
    ) {
        if ('Pagerfanta\Pagerfanta' === $parameterType) {
            $paginator = new Pagerfanta(new DoctrineORMAdapter($paginator->getQuery()));
            $paginator->setMaxPerPage($limitPerPage);
            $paginator->setCurrentPage($page);
        }
        if('Knp\Component\Pager\Pagination\PaginationInterface' === $parameterType){
            $knp = new \Knp\Component\Pager\Paginator();
            $paginator = $knp->paginate($paginator->getQuery(), $page, $limitPerPage);
        }
        return $paginator;
    }

Would that be feasible? And would that help you in using KNP-breadcrumbs?

from controllerextrabundle.

jcornide avatar jcornide commented on June 29, 2024

@ErikTrapman to create codeblocks: https://guides.github.com/features/mastering-markdown/ look for 'php'

from controllerextrabundle.

ErikTrapman avatar ErikTrapman commented on June 29, 2024

Got it. Thnx.

from controllerextrabundle.

ErikTrapman avatar ErikTrapman commented on June 29, 2024

@mmoreram any thoughts on this?

from controllerextrabundle.

mmoreram avatar mmoreram commented on June 29, 2024

@ErikTrapman Oh... yes! Why not! :)

from controllerextrabundle.

mmoreram avatar mmoreram commented on June 29, 2024

@ErikTrapman Could you please PR it with tests? :) And ping me as soon is ready! ^^

from controllerextrabundle.

ErikTrapman avatar ErikTrapman commented on June 29, 2024

lol.
Sure, i'll see what i can do, will probably be next week though.

from controllerextrabundle.

 avatar commented on June 29, 2024

@ErikTrapman have you done it? :)

from controllerextrabundle.

ErikTrapman avatar ErikTrapman commented on June 29, 2024

@JHGitty yes of course, it's right here: #84
But tests fail on HHVM due to a bug that's already been fixed, but the Travis environment that does the test is still tripping over it. Maybe @mmoreram can give it another try? If it still fails i'll mark the test skipped.

from controllerextrabundle.

 avatar commented on June 29, 2024

@ErikTrapman The bug has been fixed for HHVM >= 3.8.0. The travis test runned with HHVM version 3.5.0. That is the reason.

from controllerextrabundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.