Skip to content

Commit

Permalink
Merge pull request #302 from bocharsky-bw/patch-1
Browse files Browse the repository at this point in the history
Use more relevant method to get current page value
  • Loading branch information
pilot committed May 20, 2015
2 parents 5b6b2a5 + 68cf264 commit 800eb12
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -119,7 +119,7 @@ public function listAction(Request $request)
$paginator = $this->get('knp_paginator');
$pagination = $paginator->paginate(
$query,
$request->query->get('page', 1)/*page number*/,
$request->query->getInt('page', 1)/*page number*/,
10/*limit per page*/
);

Expand Down
2 changes: 1 addition & 1 deletion Resources/doc/custom_pagination_subscribers.md
Expand Up @@ -119,7 +119,7 @@ public function testAction()
$paginator = $this->get('knp_paginator');
$files = $paginator->paginate(
__DIR__.'/../',
$this->get('request')->query->get('page', 1),
$this->get('request')->query->getInt('page', 1),
10
);
return compact('files');
Expand Down
2 changes: 1 addition & 1 deletion Resources/doc/templates.md
Expand Up @@ -129,7 +129,7 @@ or manually with paginator options.
$paginator = $this->get('knp_paginator');
$pagination = $paginator->paginate(
$query, // target to paginate
$this->get('request')->query->get('section', 1), // page parameter, now section
$this->get('request')->query->getInt('section', 1), // page parameter, now section
10, // limit per page
array('pageParameterName' => 'section', 'sortDirectionParameterName' => 'dir')
);
Expand Down

0 comments on commit 800eb12

Please sign in to comment.