Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Member Functions | Protected Attributes
Pager Class Reference
Inheritance diagram for Pager:
Template AbstractBlock DataObject BlockInterface Pager

Public Member Functions

 getCurrentPage ()
 
 getLimit ()
 
 setLimit ($limit)
 
 setCollection ($collection)
 
 getCollection ()
 
 setPageVarName ($varName)
 
 getPageVarName ()
 
 setShowPerPage ($varName)
 
 isShowPerPage ()
 
 setLimitVarName ($varName)
 
 getLimitVarName ()
 
 setAvailableLimit (array $limits)
 
 getAvailableLimit ()
 
 getFirstNum ()
 
 getLastNum ()
 
 getTotalNum ()
 
 isFirstPage ()
 
 getLastPageNum ()
 
 isLastPage ()
 
 isLimitCurrent ($limit)
 
 isPageCurrent ($page)
 
 getPages ()
 
 getFirstPageUrl ()
 
 getPreviousPageUrl ()
 
 getNextPageUrl ()
 
 getLastPageUrl ()
 
 getPageUrl ($page)
 
 getLimitUrl ($limit)
 
 getPagerUrl ($params=[])
 
 getFrameStart ()
 
 getFrameEnd ()
 
 getFramePages ()
 
 getPreviousJumpPage ()
 
 getPreviousJumpUrl ()
 
 getNextJumpPage ()
 
 getNextJumpUrl ()
 
 getFrameLength ()
 
 getJump ()
 
 setFrameLength ($frame)
 
 setJump ($jump)
 
 canShowFirst ()
 
 canShowLast ()
 
 canShowPreviousJump ()
 
 canShowNextJump ()
 
 isFrameInitialized ()
 
 getAnchorTextForPrevious ()
 
 getAnchorTextForNext ()
 
 setIsOutputRequired ($isRequired)
 
 getFragment ()
 
 setFragment ($fragment)
 
- Public Member Functions inherited from Template
 __construct (Template\Context $context, array $data=[])
 
 setTemplateContext ($templateContext)
 
 getTemplate ()
 
 setTemplate ($template)
 
 getTemplateFile ($template=null)
 
 getArea ()
 
 assign ($key, $value=null)
 
 fetchView ($fileName)
 
 getBaseUrl ()
 
 getObjectData (\Magento\Framework\DataObject $object, $key)
 
 getCacheKeyInfo ()
 
- Public Member Functions inherited from AbstractBlock
 __construct (\Magento\Framework\View\Element\Context $context, array $data=[])
 
 getJsLayout ()
 
 getRequest ()
 
 getParentBlock ()
 
 setLayout (\Magento\Framework\View\LayoutInterface $layout)
 
 getLayout ()
 
 setNameInLayout ($name)
 
 getChildNames ()
 
 setAttribute ($name, $value=null)
 
 setChild ($alias, $block)
 
 addChild ($alias, $block, $data=[])
 
 unsetChild ($alias)
 
 unsetCallChild ($alias, $callback, $result, $params)
 
 unsetChildren ()
 
 getChildBlock ($alias)
 
 getChildHtml ($alias='', $useCache=true)
 
 getChildChildHtml ($alias, $childChildAlias='', $useCache=true)
 
 getBlockHtml ($name)
 
 insert ($element, $siblingName=0, $after=true, $alias='')
 
 append ($element, $alias='')
 
 getGroupChildNames ($groupName)
 
 getChildData ($alias, $key='')
 
 getUiId ($arg1=null, $arg2=null, $arg3=null, $arg4=null, $arg5=null)
 
 getJsId ($arg1=null, $arg2=null, $arg3=null, $arg4=null, $arg5=null)
 
 getUrl ($route='', $params=[])
 
 getViewFileUrl ($fileId, array $params=[])
 
 formatDate ( $date=null, $format=\IntlDateFormatter::SHORT, $showTime=false, $timezone=null)
 
 formatTime ( $time=null, $format=\IntlDateFormatter::SHORT, $showDate=false)
 
 getModuleName ()
 
 escapeHtml ($data, $allowedTags=null)
 
 escapeJs ($string)
 
 escapeHtmlAttr ($string, $escapeSingleQuote=true)
 
 escapeCss ($string)
 
 stripTags ($data, $allowableTags=null, $allowHtmlEntities=false)
 
 escapeUrl ($string)
 
 escapeXssInUrl ($data)
 
 escapeQuote ($data, $addSlashes=false)
 
 escapeJsQuote ($data, $quote='\'')
 
 getNameInLayout ()
 
 getCacheKeyInfo ()
 
 getCacheKey ()
 
 getVar ($name, $module=null)
 
 isScopePrivate ()
 
- Public Member Functions inherited from DataObject
 __construct (array $data=[])
 
 addData (array $arr)
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 getData ($key='', $index=null)
 
 getDataByPath ($path)
 
 getDataByKey ($key)
 
 setDataUsingMethod ($key, $args=[])
 
 getDataUsingMethod ($key, $args=null)
 
 hasData ($key='')
 
 toArray (array $keys=[])
 
 convertToArray (array $keys=[])
 
 toXml (array $keys=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 convertToXml (array $arrAttributes=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 toJson (array $keys=[])
 
 convertToJson (array $keys=[])
 
 toString ($format='')
 
 __call ($method, $args)
 
 isEmpty ()
 
 serialize ($keys=[], $valueSeparator='=', $fieldSeparator=' ', $quote='"')
 
 debug ($data=null, &$objects=[])
 
 offsetSet ($offset, $value)
 
 offsetExists ($offset)
 
 offsetUnset ($offset)
 
 offsetGet ($offset)
 
- Public Member Functions inherited from BlockInterface
 toHtml ()
 

Protected Member Functions

 _construct ()
 
 getPath ()
 
 _initFrame ()
 
 _setFrameInitialized ($flag)
 
 _toHtml ()
 
- Protected Member Functions inherited from Template
 _construct ()
 
 _toHtml ()
 
 getRootDirectory ()
 
 getMediaDirectory ()
 
- Protected Member Functions inherited from AbstractBlock
 _construct ()
 
 _prepareLayout ()
 
 _beforeToHtml ()
 
 _afterToHtml ($html)
 
 _toHtml ()
 
 _getNotFoundUrl ($route='', $params=['_direct'=> 'core/index/notFound'])
 
 getCacheTags ()
 
 getCacheLifetime ()
 
 _loadCache ()
 
 _saveCache ($data)
 
 _getSidPlaceholder ($cacheKey=null)
 
- Protected Member Functions inherited from DataObject
 _getData ($key)
 
 _underscore ($name)
 

Protected Attributes

 $_template = 'Magento_Theme::html/pager.phtml'
 
 $_collection
 
 $_pageVarName = 'p'
 
 $_limitVarName = 'limit'
 
 $_availableLimit = [10 => 10, 20 => 20, 50 => 50]
 
 $_displayPages = 5
 
 $_showPerPage = true
 
 $_limit
 
 $_outputRequired = true
 
 $_frameLength = 5
 
 $_jump = 5
 
 $_frameInitialized = false
 
 $_frameStart
 
 $_frameEnd
 
 $_fragment = null
 
- Protected Attributes inherited from Template
 $_viewVars = []
 
 $_baseUrl
 
 $_jsUrl
 
 $_allowSymlinks
 
 $_filesystem
 
 $_template
 
 $templateEnginePool
 
 $_storeManager
 
 $_appState
 
 $directory
 
 $templateContext
 
 $pageConfig
 
 $resolver
 
 $validator
 
- Protected Attributes inherited from AbstractBlock
 $_design
 
 $_session
 
 $_sidResolver
 
 $_nameInLayout
 
 $_layout
 
 $jsLayout = []
 
 $_request
 
 $_urlBuilder
 
 $_eventManager
 
 $_frontController
 
 $_assetRepo
 
 $_viewConfig
 
 $_cacheState
 
 $_logger
 
 $_escaper
 
 $filterManager
 
 $_localeDate
 
 $inlineTranslation
 
 $_isScopePrivate = false
 
 $_scopeConfig
 
 $_cache
 
- Protected Attributes inherited from DataObject
 $_data = []
 

Additional Inherited Members

- Static Public Member Functions inherited from AbstractBlock
static extractModuleName ($className)
 
- Data Fields inherited from Template
const XML_PATH_TEMPLATE_ALLOW_SYMLINK = 'dev/template/allow_symlink'
 
- Data Fields inherited from AbstractBlock
const CACHE_GROUP = \Magento\Framework\App\Cache\Type\Block::TYPE_IDENTIFIER
 
const CACHE_KEY_PREFIX = 'BLOCK_'
 
- Static Protected Attributes inherited from DataObject
static $_underscoreCache = []
 

Detailed Description

Html pager block

@SuppressWarnings(PHPMD.ExcessivePublicCount) @api

Since
100.0.2

Definition at line 15 of file Pager.php.

Member Function Documentation

◆ _construct()

_construct ( )
protected

Set pager data

Returns
void

Definition at line 113 of file Pager.php.

114  {
115  parent::_construct();
116  $this->setData('show_amounts', true);
117  $this->setData('use_container', true);
118  }
setData($key, $value=null)
Definition: DataObject.php:72

◆ _initFrame()

_initFrame ( )
protected

Initialize frame data, such as frame start, frame start etc.

Returns
$this

Definition at line 657 of file Pager.php.

658  {
659  if (!$this->isFrameInitialized()) {
660  $start = 0;
661  $end = 0;
662 
663  $collection = $this->getCollection();
664  if ($collection->getLastPageNumber() <= $this->getFrameLength()) {
665  $start = 1;
666  $end = $collection->getLastPageNumber();
667  } else {
668  $half = ceil($this->getFrameLength() / 2);
669  if ($collection->getCurPage() >= $half &&
670  $collection->getCurPage() <= $collection->getLastPageNumber() - $half
671  ) {
672  $start = $collection->getCurPage() - $half + 1;
673  $end = $start + $this->getFrameLength() - 1;
674  } elseif ($collection->getCurPage() < $half) {
675  $start = 1;
676  $end = $this->getFrameLength();
677  } elseif ($collection->getCurPage() > $collection->getLastPageNumber() - $half) {
678  $end = $collection->getLastPageNumber();
679  $start = $end - $this->getFrameLength() + 1;
680  }
681  }
682  $this->_frameStart = $start;
683  $this->_frameEnd = $end;
684 
685  $this->_setFrameInitialized(true);
686  }
687 
688  return $this;
689  }
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17
$start
Definition: listing.phtml:18

◆ _setFrameInitialized()

_setFrameInitialized (   $flag)
protected

Setter for flag _frameInitialized

Parameters
bool$flag
Returns
$this

Definition at line 697 of file Pager.php.

698  {
699  $this->_frameInitialized = (bool)$flag;
700  return $this;
701  }

◆ _toHtml()

_toHtml ( )
protected

Determine whether the pagination should be eventually rendered

Returns
string

Definition at line 756 of file Pager.php.

757  {
758  if ($this->_outputRequired || $this->getTotalNum() > $this->getLimit()) {
759  return parent::_toHtml();
760  }
761  return '';
762  }

◆ canShowFirst()

canShowFirst ( )

Whether to show first page in pagination or not

Returns
bool

Definition at line 617 of file Pager.php.

618  {
619  return $this->getJump() > 1 && $this->getFrameStart() > 1;
620  }

◆ canShowLast()

canShowLast ( )

Whether to show last page in pagination or not

Returns
bool

Definition at line 627 of file Pager.php.

628  {
629  return $this->getJump() > 1 && $this->getFrameEnd() < $this->getLastPageNum();
630  }

◆ canShowNextJump()

canShowNextJump ( )

Whether to show link to Next Jump

Returns
bool

Definition at line 647 of file Pager.php.

648  {
649  return $this->getNextJumpPage() !== null;
650  }

◆ canShowPreviousJump()

canShowPreviousJump ( )

Whether to show link to Previous Jump

Returns
bool

Definition at line 637 of file Pager.php.

638  {
639  return $this->getPreviousJumpPage() !== null;
640  }

◆ getAnchorTextForNext()

getAnchorTextForNext ( )

Getter for alternative text for Next link in pagination frame

Returns
string

Definition at line 731 of file Pager.php.

732  {
733  return $this->_scopeConfig->getValue(
734  'design/pagination/anchor_text_for_next',
735  \Magento\Store\Model\ScopeInterface::SCOPE_STORE
736  );
737  }

◆ getAnchorTextForPrevious()

getAnchorTextForPrevious ( )

Getter for alternative text for Previous link in pagination frame

Returns
string

Definition at line 718 of file Pager.php.

719  {
720  return $this->_scopeConfig->getValue(
721  'design/pagination/anchor_text_for_previous',
722  \Magento\Store\Model\ScopeInterface::SCOPE_STORE
723  );
724  }

◆ getAvailableLimit()

getAvailableLimit ( )

Retrieve pager limit

Returns
array

Definition at line 272 of file Pager.php.

273  {
274  return $this->_availableLimit;
275  }

◆ getCollection()

getCollection ( )
Returns
\Magento\Framework\Data\Collection

Definition at line 189 of file Pager.php.

190  {
191  return $this->_collection;
192  }

◆ getCurrentPage()

getCurrentPage ( )

Return current page

Returns
int

Definition at line 125 of file Pager.php.

126  {
127  if (is_object($this->_collection)) {
128  return $this->_collection->getCurPage();
129  }
130  return (int)$this->getRequest()->getParam($this->getPageVarName(), 1);
131  }
$this _collection
Definition: coupons.php:7

◆ getFirstNum()

getFirstNum ( )
Returns
int

Definition at line 280 of file Pager.php.

281  {
282  $collection = $this->getCollection();
283  return $collection->getPageSize() * ($collection->getCurPage() - 1) + 1;
284  }

◆ getFirstPageUrl()

getFirstPageUrl ( )
Returns
string

Definition at line 382 of file Pager.php.

383  {
384  return $this->getPageUrl(1);
385  }

◆ getFragment()

getFragment ( )

Get the URL fragment

Returns
string|null

Definition at line 769 of file Pager.php.

770  {
771  return $this->_fragment;
772  }

◆ getFrameEnd()

getFrameEnd ( )

Getter for $_frameEnd

Returns
int

Definition at line 479 of file Pager.php.

480  {
481  $this->_initFrame();
482  return $this->_frameEnd;
483  }

◆ getFrameLength()

getFrameLength ( )

Getter for $_frameLength

Returns
int

Definition at line 560 of file Pager.php.

561  {
562  return $this->_frameLength;
563  }

◆ getFramePages()

getFramePages ( )

Return array of pages in frame

Returns
array

Definition at line 490 of file Pager.php.

491  {
492  $start = $this->getFrameStart();
493  $end = $this->getFrameEnd();
494  return range($start, $end);
495  }
$start
Definition: listing.phtml:18

◆ getFrameStart()

getFrameStart ( )

Getter for $_frameStart

Returns
int

Definition at line 468 of file Pager.php.

469  {
470  $this->_initFrame();
471  return $this->_frameStart;
472  }

◆ getJump()

getJump ( )

Getter for $_jump

Returns
int

Definition at line 570 of file Pager.php.

571  {
572  return $this->_jump;
573  }

◆ getLastNum()

getLastNum ( )
Returns
int

Definition at line 289 of file Pager.php.

290  {
291  $collection = $this->getCollection();
292  return $collection->getPageSize() * ($collection->getCurPage() - 1) + $collection->count();
293  }

◆ getLastPageNum()

getLastPageNum ( )

Retrieve number of last page

Returns
int

Definition at line 320 of file Pager.php.

321  {
322  return $this->getCollection()->getLastPageNumber();
323  }

◆ getLastPageUrl()

getLastPageUrl ( )

Retrieve last page URL

Returns
string

Definition at line 412 of file Pager.php.

413  {
414  return $this->getPageUrl($this->getCollection()->getLastPageNumber());
415  }

◆ getLimit()

getLimit ( )

Return current page limit

Returns
int

Definition at line 138 of file Pager.php.

139  {
140  if ($this->_limit !== null) {
141  return $this->_limit;
142  }
143 
144  $limits = $this->getAvailableLimit();
145  if ($limit = $this->getRequest()->getParam($this->getLimitVarName())) {
146  if (isset($limits[$limit])) {
147  return $limit;
148  }
149  }
150 
151  $limits = array_keys($limits);
152  return $limits[0];
153  }

◆ getLimitUrl()

getLimitUrl (   $limit)
Parameters
int$limit
Returns
string

Definition at line 432 of file Pager.php.

433  {
434  return $this->getPagerUrl([$this->getLimitVarName() => $limit]);
435  }

◆ getLimitVarName()

getLimitVarName ( )

Retrieve name for pager limit data

Returns
string

Definition at line 250 of file Pager.php.

251  {
252  return $this->_limitVarName;
253  }

◆ getNextJumpPage()

getNextJumpPage ( )

Return page number of Next jump

Returns
int|null

Definition at line 531 of file Pager.php.

532  {
533  if (!$this->getJump()) {
534  return null;
535  }
536 
537  $frameEnd = $this->getFrameEnd();
538  if ($this->getLastPageNum() - $frameEnd > 1) {
539  return min($this->getLastPageNum() - 1, $frameEnd + $this->getJump());
540  }
541 
542  return null;
543  }

◆ getNextJumpUrl()

getNextJumpUrl ( )

Prepare URL for Next Jump

Returns
string

Definition at line 550 of file Pager.php.

551  {
552  return $this->getPageUrl($this->getNextJumpPage());
553  }

◆ getNextPageUrl()

getNextPageUrl ( )

Retrieve next page URL

Returns
string

Definition at line 402 of file Pager.php.

403  {
404  return $this->getPageUrl($this->getCollection()->getCurPage(+1));
405  }

◆ getPagerUrl()

getPagerUrl (   $params = [])

Retrieve page URL by defined parameters

Parameters
array$params
Returns
string

Definition at line 443 of file Pager.php.

444  {
445  $urlParams = [];
446  $urlParams['_current'] = true;
447  $urlParams['_escape'] = true;
448  $urlParams['_use_rewrite'] = true;
449  $urlParams['_fragment'] = $this->getFragment();
450  $urlParams['_query'] = $params;
451 
452  return $this->getUrl($this->getPath(), $urlParams);
453  }
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
Definition: website.php:18

◆ getPages()

getPages ( )
Returns
array

Definition at line 356 of file Pager.php.

357  {
358  $collection = $this->getCollection();
359  if ($collection->getLastPageNumber() <= $this->_displayPages) {
360  return range(1, $collection->getLastPageNumber());
361  } else {
362  $half = ceil($this->_displayPages / 2);
363  if ($collection->getCurPage() >= $half &&
364  $collection->getCurPage() <= $collection->getLastPageNumber() - $half
365  ) {
366  $start = $collection->getCurPage() - $half + 1;
367  $finish = $start + $this->_displayPages - 1;
368  } elseif ($collection->getCurPage() < $half) {
369  $start = 1;
370  $finish = $this->_displayPages;
371  } elseif ($collection->getCurPage() > $collection->getLastPageNumber() - $half) {
372  $finish = $collection->getLastPageNumber();
373  $start = $finish - $this->_displayPages + 1;
374  }
375  return range($start, $finish);
376  }
377  }
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17
$start
Definition: listing.phtml:18

◆ getPageUrl()

getPageUrl (   $page)

Retrieve page URL

Parameters
string$page
Returns
string

Definition at line 423 of file Pager.php.

424  {
425  return $this->getPagerUrl([$this->getPageVarName() => $page]);
426  }
$page
Definition: pages.php:8

◆ getPageVarName()

getPageVarName ( )
Returns
string

Definition at line 207 of file Pager.php.

208  {
209  return $this->_pageVarName;
210  }

◆ getPath()

getPath ( )
protected
Returns
string

Definition at line 458 of file Pager.php.

459  {
460  return $this->_getData('path') ?: '*/*/*';
461  }

◆ getPreviousJumpPage()

getPreviousJumpPage ( )

Return page number of Previous jump

Returns
int|null

Definition at line 502 of file Pager.php.

503  {
504  if (!$this->getJump()) {
505  return null;
506  }
507 
508  $frameStart = $this->getFrameStart();
509  if ($frameStart - 1 > 1) {
510  return max(2, $frameStart - $this->getJump());
511  }
512 
513  return null;
514  }

◆ getPreviousJumpUrl()

getPreviousJumpUrl ( )

Prepare URL for Previous Jump

Returns
string

Definition at line 521 of file Pager.php.

522  {
523  return $this->getPageUrl($this->getPreviousJumpPage());
524  }

◆ getPreviousPageUrl()

getPreviousPageUrl ( )

Retrieve previous page URL

Returns
string

Definition at line 392 of file Pager.php.

393  {
394  return $this->getPageUrl($this->getCollection()->getCurPage(-1));
395  }

◆ getTotalNum()

getTotalNum ( )

Retrieve total number of pages

Returns
int

Definition at line 300 of file Pager.php.

301  {
302  return $this->getCollection()->getSize();
303  }

◆ isFirstPage()

isFirstPage ( )

Check if current page is a first page in collection

Returns
bool

Definition at line 310 of file Pager.php.

311  {
312  return $this->getCollection()->getCurPage() == 1;
313  }

◆ isFrameInitialized()

isFrameInitialized ( )

Check if frame data was initialized

Returns
bool

Definition at line 708 of file Pager.php.

709  {
711  }

◆ isLastPage()

isLastPage ( )

Check if current page is a last page in collection

Returns
bool

Definition at line 330 of file Pager.php.

331  {
332  return $this->getCollection()->getCurPage() >= $this->getLastPageNum();
333  }

◆ isLimitCurrent()

isLimitCurrent (   $limit)
Parameters
int$limit
Returns
bool

Definition at line 339 of file Pager.php.

340  {
341  return $limit == $this->getLimit();
342  }

◆ isPageCurrent()

isPageCurrent (   $page)
Parameters
int$page
Returns
bool

Definition at line 348 of file Pager.php.

349  {
350  return $page == $this->getCurrentPage();
351  }
$page
Definition: pages.php:8

◆ isShowPerPage()

isShowPerPage ( )
Returns
bool

Definition at line 225 of file Pager.php.

226  {
227  if (sizeof($this->getAvailableLimit()) <= 1) {
228  return false;
229  }
230  return $this->_showPerPage;
231  }

◆ setAvailableLimit()

setAvailableLimit ( array  $limits)

Set pager limit

Parameters
array$limits
Returns
$this

Definition at line 261 of file Pager.php.

262  {
263  $this->_availableLimit = $limits;
264  return $this;
265  }

◆ setCollection()

setCollection (   $collection)

Set collection for pagination

Parameters
\Magento\Framework\Data\Collection$collection
Returns
$this

Definition at line 173 of file Pager.php.

174  {
175  $this->_collection = $collection->setCurPage($this->getCurrentPage());
176  // If not int - then not limit
177  if ((int)$this->getLimit()) {
178  $this->_collection->setPageSize($this->getLimit());
179  }
180 
181  $this->_setFrameInitialized(false);
182 
183  return $this;
184  }
$this _collection
Definition: coupons.php:7

◆ setFragment()

setFragment (   $fragment)

Set the URL fragment

Parameters
string | null$fragment
Returns
$this

Definition at line 780 of file Pager.php.

781  {
782  $this->_fragment = $fragment;
783  return $this;
784  }

◆ setFrameLength()

setFrameLength (   $frame)

Setter for $_frameLength

Parameters
int$frame
Returns
$this

Definition at line 581 of file Pager.php.

582  {
583  $frame = abs(intval($frame));
584  if ($frame == 0) {
585  $frame = $this->_frameLength;
586  }
587  if ($this->getFrameLength() != $frame) {
588  $this->_setFrameInitialized(false);
589  $this->_frameLength = $frame;
590  }
591 
592  return $this;
593  }

◆ setIsOutputRequired()

setIsOutputRequired (   $isRequired)

Set whether output of the pager is mandatory

Parameters
bool$isRequired
Returns
$this

Definition at line 745 of file Pager.php.

746  {
747  $this->_outputRequired = (bool)$isRequired;
748  return $this;
749  }

◆ setJump()

setJump (   $jump)

Setter for $_jump

Parameters
int$jump
Returns
$this

Definition at line 601 of file Pager.php.

602  {
603  $jump = abs(intval($jump));
604  if ($this->getJump() != $jump) {
605  $this->_setFrameInitialized(false);
606  $this->_jump = $jump;
607  }
608 
609  return $this;
610  }

◆ setLimit()

setLimit (   $limit)

Setter for limit items per page

Parameters
int$limit
Returns
$this

Definition at line 161 of file Pager.php.

162  {
163  $this->_limit = $limit;
164  return $this;
165  }

◆ setLimitVarName()

setLimitVarName (   $varName)

Set the name for pager limit data

Parameters
string$varName
Returns
$this

Definition at line 239 of file Pager.php.

240  {
241  $this->_limitVarName = $varName;
242  return $this;
243  }

◆ setPageVarName()

setPageVarName (   $varName)
Parameters
string$varName
Returns
$this

Definition at line 198 of file Pager.php.

199  {
200  $this->_pageVarName = $varName;
201  return $this;
202  }

◆ setShowPerPage()

setShowPerPage (   $varName)
Parameters
bool$varName
Returns
$this

Definition at line 216 of file Pager.php.

217  {
218  $this->_showPerPage = $varName;
219  return $this;
220  }

Field Documentation

◆ $_availableLimit

$_availableLimit = [10 => 10, 20 => 20, 50 => 50]
protected

Definition at line 44 of file Pager.php.

◆ $_collection

$_collection
protected

Definition at line 27 of file Pager.php.

◆ $_displayPages

$_displayPages = 5
protected

Definition at line 49 of file Pager.php.

◆ $_fragment

$_fragment = null
protected

Definition at line 106 of file Pager.php.

◆ $_frameEnd

$_frameEnd
protected

Definition at line 99 of file Pager.php.

◆ $_frameInitialized

$_frameInitialized = false
protected

Definition at line 85 of file Pager.php.

◆ $_frameLength

$_frameLength = 5
protected

Definition at line 71 of file Pager.php.

◆ $_frameStart

$_frameStart
protected

Definition at line 92 of file Pager.php.

◆ $_jump

$_jump = 5
protected

Definition at line 78 of file Pager.php.

◆ $_limit

$_limit
protected

Definition at line 59 of file Pager.php.

◆ $_limitVarName

$_limitVarName = 'limit'
protected

Definition at line 37 of file Pager.php.

◆ $_outputRequired

$_outputRequired = true
protected

Definition at line 64 of file Pager.php.

◆ $_pageVarName

$_pageVarName = 'p'
protected

Definition at line 32 of file Pager.php.

◆ $_showPerPage

$_showPerPage = true
protected

Definition at line 54 of file Pager.php.

◆ $_template

$_template = 'Magento_Theme::html/pager.phtml'
protected

Definition at line 22 of file Pager.php.


The documentation for this class was generated from the following file: