Skip to content

Commit

Permalink
Merge 2910721 into ba21c65
Browse files Browse the repository at this point in the history
  • Loading branch information
sangar82 committed Jul 31, 2014
2 parents ba21c65 + 2910721 commit 2bc1550
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/Pagination/IlluminatePaginatorAdapter.php
Expand Up @@ -50,4 +50,32 @@ public function getCount()
{
return $this->count();
}

/**
* Override method so includes work with pagination
* @param Int $page
* @return String
*/
public function getUrl($page)
{
$parameters = array(
$this->factory->getPageName() => $page,
);

// append the querystring to the pagination links
$queryStrings = array_except( \Input::query(), $this->factory->getPageName() );
$this->appends($queryStrings);

// If we have any extra query string key / value pairs that need to be added
// onto the URL, we will put them in query string form and then attach it
// to the URL. This allows for extra information like sortings storage.
if (count($this->query) > 0)
{
$parameters = array_merge($parameters, $this->query);
}

$fragment = $this->buildFragment();

return $this->factory->getCurrentUrl().'?'.http_build_query($parameters, null, '&').$fragment;
}
}

0 comments on commit 2bc1550

Please sign in to comment.