Skip to content

Instantly share code, notes, and snippets.

@ScullWM
Created March 18, 2013 17:27
Show Gist options
  • Save ScullWM/5189067 to your computer and use it in GitHub Desktop.
Save ScullWM/5189067 to your computer and use it in GitHub Desktop.
Manage pagination in controller
<?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;
}
}
@chibani
Copy link

chibani commented Mar 21, 2013

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