src/Serializer.php
protected function addPaginationHeaders($pagination)
    {
        $links = [];
        foreach ($pagination->getLinks(true) as $rel => $url) {
            $links[] = "<$url>; rel=$rel";
        }

        $this->response->setHeader($this->totalCountHeader, $pagination->totalCount);
        $this->response->setHeader($this->pageCountHeader, $pagination->getPageCount());
        $this->response->setHeader($this->currentPageHeader, $pagination->getPage() + 1);
        $this->response->setHeader($this->perPageHeader, $pagination->pageSize);
        $this->response->setHeader('Link', implode(', ', $links));
    }
protected function addPaginationHeaders($pagination)
    {
        $links = [];
        foreach ($pagination->getLinks(true) as $rel => $url) {
            $links[] = "<$url>; rel=$rel";
        }

        $this->response->setHeader($this->totalCountHeader, $pagination->totalCount);
        $this->response->setHeader($this->pageCountHeader, $pagination->getPageCount());
        $this->response->setHeader($this->currentPageHeader, $pagination->getPage() + 1);
        $this->response->setHeader($this->perPageHeader, $pagination->pageSize);
        $this->response->setHeader('Link', implode(', ', $links));
    }
protected function addPaginationHeaders ( $ pagination ) { $ links = [ ] ; foreach ( $ pagination -> getLinks ( true ) as $ rel => $ url ) { $ links [ ] = "<$url>; rel=$rel" ; } $ this -> response -> setHeader ( $ this -> totalCountHeader , $ pagination -> totalCount ) ; $ this -> response -> setHeader ( $ this -> pageCountHeader , $ pagination -> getPageCount ( ) ) ; $ this -> response -> setHeader ( $ this -> currentPageHeader , $ pagination -> getPage ( ) + 1 ) ; $ this -> response -> setHeader ( $ this -> perPageHeader , $ pagination -> pageSize ) ; $ this -> response -> setHeader ( 'Link' , implode ( ', ' , $ links ) ) ; }
Adds HTTP headers about the pagination to the response.
@param Pagination $pagination
Adds HTTP headers about the pagination to the response .