Comments (10)
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.
@ErikTrapman to create codeblocks: https://guides.github.com/features/mastering-markdown/ look for 'php'
from controllerextrabundle.
Got it. Thnx.
from controllerextrabundle.
@mmoreram any thoughts on this?
from controllerextrabundle.
@ErikTrapman Oh... yes! Why not! :)
from controllerextrabundle.
@ErikTrapman Could you please PR it with tests? :) And ping me as soon is ready! ^^
from controllerextrabundle.
lol.
Sure, i'll see what i can do, will probably be next week though.
from controllerextrabundle.
@ErikTrapman have you done it? :)
from controllerextrabundle.
@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.
@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)
- Version 2 HOT 2
- orwhere and substring search
- @JsonResponse Ignored When Using JMSSecurityExtraBundle HOT 11
- Adding PagerFanta Support HOT 6
- v1.1.5 has a dependency on a non-existent service "request_stack" HOT 3
- Support FormAnnotation with no form parameter HOT 2
- Get Query or Post params on annotation HOT 2
- Unrecognized option "pagination" under "controller_extra" HOT 5
- Multiple wheres not works
- Like with value from get parameter and wildcards not works
- Multiple paginator params don't work HOT 2
- Header annotation HOT 5
- Wildcard % not working properly HOT 3
- Problems using dates in the paginator where params HOT 1
- ODM support HOT 1
- Problem when using boolean params in the where filters
- PaginatorAnnotation Factory Pattern HOT 4
- Rename PaginatorAnnotation to Paginator HOT 1
- PaginatorWheresEvaluator bug HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from controllerextrabundle.