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

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

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