Skip to content

Commit

Permalink
add url fragment to pager
Browse files Browse the repository at this point in the history
  • Loading branch information
tzyganu committed Feb 9, 2015
1 parent 5887153 commit e263e05
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion app/code/Magento/Theme/Block/Html/Pager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -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;
}

/**
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
}

0 comments on commit e263e05

Please sign in to comment.