Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Revert "improve omitFirstPage"
Browse files Browse the repository at this point in the history
This reverts commit dfe64b7.

Fixes #158
  • Loading branch information
Sam Partington committed Nov 30, 2017
1 parent 5fd47a5 commit a252e1d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Twig/PagerfantaExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ private function createRouteGenerator($options = array())

return function($page) use($router, $routeName, $routeParams, $pagePropertyPath, $omitFirstPage) {
$propertyAccessor = PropertyAccess::createPropertyAccessor();
// don't set the page parameter if it is the first page and the omitFirstPage flag is true
if(!$omitFirstPage || $page > 1 ){
if($omitFirstPage){
$propertyAccessor->setValue($routeParams, $pagePropertyPath, $page > 1 ? $page : null);
} else {
$propertyAccessor->setValue($routeParams, $pagePropertyPath, $page);
}

Expand Down

0 comments on commit a252e1d

Please sign in to comment.