Created
February 17, 2014 23:35
-
-
Save brandonkelly/9061498 to your computer and use it in GitHub Desktop.
Add a craft.request.getPageNum() function to Craft
This file contains 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
diff --git Source/craft/app/variables/HttpRequestVariable.php Source/craft/app/variables/HttpRequestVariable.php | |
index fad31b7edab84f5c428e3ce2c3b3ec6e8d92e7ef..430e1adcdf801cccabaf67c89001465c8835fba7 100644 | |
--- Source/craft/app/variables/HttpRequestVariable.php | |
+++ Source/craft/app/variables/HttpRequestVariable.php | |
@@ -201,4 +201,14 @@ class HttpRequestVariable | |
{ | |
return craft()->request->isMobileBrowser($detectTablets); | |
} | |
+ | |
+ /** | |
+ * Returns the page number if this is a paginated request. | |
+ * | |
+ * @return int | |
+ */ | |
+ public function getPageNum() | |
+ { | |
+ return craft()->request->getPageNum(); | |
+ } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment