Source for file Paginator.php
Documentation is available at Paginator.php
- 1: <?php
- 3: /**
- 4: * Nette Framework
- 5: *
- 6: * Copyright (c) 2004, 2009 David Grudl (http://davidgrudl.com)
- 7: *
- 8: * This source file is subject to the "Nette license" that is bundled
- 9: * with this package in the file license.txt.
- 10: *
- 11: * For more information please see http://nettephp.com
- 12: *
- 18: */
- 22: /**
- 23: * Paginating math.
- 24: *
- 28: *
- 41: */
- 43: {
- 58: /**
- 59: * Sets current page number.
- 62: */
- 64: {
- 67: }
- 71: /**
- 72: * Returns current page number.
- 74: */
- 76: {
- 78: }
- 82: /**
- 83: * Returns first page number.
- 85: */
- 87: {
- 89: }
- 93: /**
- 94: * Returns last page number.
- 96: */
- 98: {
- 100: }
- 104: /**
- 105: * Sets first page (base) number.
- 108: */
- 110: {
- 113: }
- 117: /**
- 118: * Returns first page (base) number.
- 120: */
- 122: {
- 124: }
- 128: /**
- 129: * Returns zero-based page number.
- 131: */
- 133: {
- 135: }
- 139: /**
- 140: * Is the current page the first one?
- 142: */
- 144: {
- 146: }
- 150: /**
- 151: * Is the current page the last one?
- 153: */
- 155: {
- 157: }
- 161: /**
- 162: * Returns the total number of pages.
- 164: */
- 166: {
- 168: }
- 172: /**
- 173: * Sets the number of items to display on a single page.
- 176: */
- 178: {
- 181: }
- 185: /**
- 186: * Returns the number of items to display on a single page.
- 188: */
- 190: {
- 192: }
- 196: /**
- 197: * Sets the total number of items.
- 200: */
- 202: {
- 205: }
- 209: /**
- 210: * Returns the total number of items.
- 212: */
- 214: {
- 216: }
- 220: /**
- 221: * Returns the absolute index of the first item on current page.
- 223: */
- 225: {
- 227: }
- 231: /**
- 232: * Returns the absolute index of the first item on current page in countdown paging.
- 234: */
- 236: {
- 238: }
- 242: /**
- 243: * Returns the number of items on current page.
- 245: */
- 247: {
- 248: return min($this->itemsPerPage, $this->itemCount - $this->getPageIndex() * $this->itemsPerPage);
- 249: }
- 251: }