Changeset 2097 for trunk/system/libraries/Pagination.php
- Timestamp:
- 02/21/2008 11:02:24 AM (9 months ago)
- Files:
-
- 1 modified
-
trunk/system/libraries/Pagination.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/libraries/Pagination.php
r2029 r2097 19 19 protected $items_per_page = 10; 20 20 protected $total_items = 0; 21 protected $auto_hide = FALSE; 21 22 22 23 // Automatically generated values … … 117 118 * @return string pagination html 118 119 */ 119 public function create_links($style = NULL)120 public function render($style = NULL) 120 121 { 121 $style = (isset($style)) ? $style : $this->style; 122 $view = new View($this->directory.$style, get_object_vars($this)); 123 return $view->render(); 122 // Hide single page pagination 123 if ($this->auto_hide == TRUE AND $this->total_pages <= 1) 124 return ''; 125 126 if ($style === NULL) 127 { 128 // Use default style 129 $style = $this->style; 130 } 131 132 // Return rendered pagination view 133 return View::factory($this->directory.$style, get_object_vars($this))->render(); 124 134 } 125 135 … … 131 141 public function __toString() 132 142 { 133 return $this-> create_links();143 return $this->render(); 134 144 } 135 145
