Pagination::__construct PHP Méthode

__construct() public méthode

Constructor
public __construct ( mixed $count, integer $limit, array $params = [] )
$count mixed Either an integer or a Collection
$limit integer The number of items per page
$params array Additional parameters to control the pagination object
    public function __construct($count, $limit, $params = array())
    {
        // You can still pass an entire collection
        if ($count instanceof Collection) {
            $count = $count->count();
        }
        $this->options = array_merge(static::$defaults, $params);
        $this->count = (int) $count;
        $this->limit = (int) $limit;
        $this->pages = (int) ceil($this->count / $this->limit);
        $this->offset = (int) (($this->page() - 1) * $this->limit);
    }

Usage Example

 public function __construct($params = null)
 {
     parent::__construct($params);
 }
All Usage Examples Of Pagination::__construct