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: {
- 66: }
- 70: /**
- 71: * Returns current page number.
- 73: */
- 75: {
- 77: }
- 81: /**
- 82: * Returns first page number.
- 84: */
- 86: {
- 88: }
- 92: /**
- 93: * Returns last page number.
- 95: */
- 97: {
- 99: }
- 103: /**
- 104: * Sets first page (base) number.
- 107: */
- 109: {
- 111: }
- 115: /**
- 116: * Returns first page (base) number.
- 118: */
- 120: {
- 122: }
- 126: /**
- 127: * Returns zero-based page number.
- 129: */
- 131: {
- 133: }
- 137: /**
- 138: * Is the current page the first one?
- 140: */
- 142: {
- 144: }
- 148: /**
- 149: * Is the current page the last one?
- 151: */
- 153: {
- 155: }
- 159: /**
- 160: * Returns the total number of pages.
- 162: */
- 164: {
- 166: }
- 170: /**
- 171: * Sets the number of items to display on a single page.
- 174: */
- 176: {
- 178: }
- 182: /**
- 183: * Returns the number of items to display on a single page.
- 185: */
- 187: {
- 189: }
- 193: /**
- 194: * Sets the total number of items.
- 197: */
- 199: {
- 201: }
- 205: /**
- 206: * Returns the total number of items.
- 208: */
- 210: {
- 212: }
- 216: /**
- 217: * Returns the absolute index of the first item on current page.
- 219: */
- 221: {
- 223: }
- 227: /**
- 228: * Returns the absolute index of the first item on current page in countdown paging.
- 230: */
- 232: {
- 234: }
- 238: /**
- 239: * Returns the number of items on current page.
- 241: */
- 243: {
- 244: return min($this->itemsPerPage, $this->itemCount - $this->getPageIndex() * $this->itemsPerPage);
- 245: }
- 247: }