From e263e05d186ac0a212ce07a37039f66582709b00 Mon Sep 17 00:00:00 2001 From: Marius Strajeru Date: Mon, 9 Feb 2015 14:32:36 +0200 Subject: [PATCH 1/2] add url fragment to pager --- app/code/Magento/Theme/Block/Html/Pager.php | 33 ++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Theme/Block/Html/Pager.php b/app/code/Magento/Theme/Block/Html/Pager.php index bb67af11ba6ca..74d9b3d2cfa2b 100644 --- a/app/code/Magento/Theme/Block/Html/Pager.php +++ b/app/code/Magento/Theme/Block/Html/Pager.php @@ -95,6 +95,13 @@ class Pager extends \Magento\Framework\View\Element\Template */ protected $_frameEnd; + /** + * Url Fragment for pagination + * + * @var string|null + */ + protected $_fragment = null; + /** * Set pager data * @@ -246,11 +253,12 @@ public function getLimitVarName() * Set pager limit * * @param array $limits - * @return void + * @return $this */ public function setAvailableLimit(array $limits) { $this->_availableLimit = $limits; + return $this; } /** @@ -435,6 +443,7 @@ public function getPagerUrl($params = []) $urlParams['_current'] = true; $urlParams['_escape'] = true; $urlParams['_use_rewrite'] = true; + $urlParams['_fragment'] = $this->getFragment(); $urlParams['_query'] = $params; return $this->getUrl('*/*/*', $urlParams); @@ -740,4 +749,26 @@ protected function _toHtml() } return ''; } + + /** + * get the url fragment + * + * @return string|null + */ + public function getFragment() + { + return $this->_fragment; + } + + /** + * set the url fragment + * @param $fragment + * + * @return $this + */ + public function setFragment($fragment) + { + $this->_fragment = $fragment; + return $this; + } } From 904e30c1d50d057408bee06e2d3db070ffe6bdac Mon Sep 17 00:00:00 2001 From: Vladimir Pelipenko Date: Wed, 11 Feb 2015 18:55:03 +0200 Subject: [PATCH 2/2] MAGETWO-34066: [GITHUB] Pager block should support url "fragment" #996 - small fixes in annotations --- app/code/Magento/Theme/Block/Html/Pager.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Theme/Block/Html/Pager.php b/app/code/Magento/Theme/Block/Html/Pager.php index 74d9b3d2cfa2b..ca72861dfd12d 100644 --- a/app/code/Magento/Theme/Block/Html/Pager.php +++ b/app/code/Magento/Theme/Block/Html/Pager.php @@ -751,7 +751,7 @@ protected function _toHtml() } /** - * get the url fragment + * Get the URL fragment * * @return string|null */ @@ -761,9 +761,9 @@ public function getFragment() } /** - * set the url fragment - * @param $fragment + * Set the URL fragment * + * @param string|null $fragment * @return $this */ public function setFragment($fragment)