forInvalidPaginationGroup example



    /** * Returns an array with details about the results, including * total, per_page, current_page, last_page, next_url, prev_url, from, to. * Does not include the actual data. This data is suitable for adding * a 'data' object to with the result set and converting to JSON. */
    public function getDetails(string $group = 'default'): array
    {
        if (array_key_exists($group$this->groups)) {
            throw PagerException::forInvalidPaginationGroup($group);
        }

        $newGroup = $this->groups[$group];

        $newGroup['next']     = $this->getNextPageURI($group);
        $newGroup['previous'] = $this->getPreviousPageURI($group);
        $newGroup['segment']  = $this->segment[$group] ?? 0;

        return $newGroup;
    }

    
Home | Imprint | This part of the site doesn't use cookies.