Created
July 31, 2014 14:47
-
-
Save sangar82/2eb42e67ddc0be45d727 to your computer and use it in GitHub Desktop.
laravel/vendor/league/fractal/src/Pagination\IlluminatePaginatorAdapter.php
This file contains hidden or 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
| /** | |
| * 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; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment