Pagination::limit PHP Method

limit() public method

Returns the chosen limit This is used for the slice() method together with the offset to get the correct items from collections
public limit ( ) : integer
return integer
    public function limit()
    {
        return $this->limit;
    }

Usage Example

Example #1
0
 /**
  * Add pagination
  *
  * @param int $limit the number of items per page
  * @param array $options and optional array with options for the pagination class
  * @return object a sliced set of data
  */
 public function paginate($limit, $options = array())
 {
     if (is_a($limit, 'Pagination')) {
         $this->pagination = $limit;
         return $this;
     }
     $pagination = new Pagination($this->count(), $limit, $options);
     $pages = $this->slice($pagination->offset(), $pagination->limit());
     $pages->pagination = $pagination;
     return $pages;
 }
All Usage Examples Of Pagination::limit