Created
March 18, 2013 17:27
-
-
Save ScullWM/5189067 to your computer and use it in GitHub Desktop.
Manage pagination in controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MyController | |
{ | |
public function myAction(Request $request, App $app) | |
{ | |
$pager = new Pagination(); | |
$pager->nbreResult = 100; | |
if($request->getParam('nbreItemPage')!=$app->param->defaultNbreItemPage): | |
$pager->nbreItemPage = $request->getParam('nbreItemPage'); | |
$request->setParam('nbreItemPage', 10); | |
else: | |
$pager->nbreItemPage = $app->param->defaultNbreItemPage; | |
endif; | |
} | |
} |
Un bête héritage d'une classe PaginatedController ?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environement :
Problématique:
Le truc relou: Comment le choix d'un simple menu déroulant peut redescendre jusqu'à ma classe de pagination sans devoir transformer mes contrôleurs en "gruyère" ?
(ps:Utiliser un truc comme jqgrid n'est pas forcément adapté, surtout si on à une mise en page autre qu'un tableau)
UNE IDEE ?