public function beforeRender(Event $event)
    {
        $request = $this->_request();

        if (empty($request->getParam('paging'))) {
            return;
        }

        $controller = $this->_controller();

        list(, $modelClass) = pluginSplit($controller->modelClass);

        if (!array_key_exists($modelClass, $request->getParam('paging'))) {
            return;
        }

        $pagination = $request->getParam('paging')[$modelClass];
        if (empty($pagination)) {
            return;
        }

        $controller->set('_pagination', $this->_getJsonApiPaginationResponse($pagination));
    }
public function beforeRender(Event $event)
    {
        $request = $this->_request();

        if (empty($request->getParam('paging'))) {
            return;
        }

        $controller = $this->_controller();

        list(, $modelClass) = pluginSplit($controller->modelClass);

        if (!array_key_exists($modelClass, $request->getParam('paging'))) {
            return;
        }

        $pagination = $request->getParam('paging')[$modelClass];
        if (empty($pagination)) {
            return;
        }

        $controller->set('_pagination', $this->_getJsonApiPaginationResponse($pagination));
    }
public function beforeRender ( Event $ event ) { $ request = $ this -> _request ( ) ; if ( empty ( $ request -> getParam ( 'paging' ) ) ) { return ; } $ controller = $ this -> _controller ( ) ; list ( , $ modelClass ) = pluginSplit ( $ controller -> modelClass ) ; if ( ! array_key_exists ( $ modelClass , $ request -> getParam ( 'paging' ) ) ) { return ; } $ pagination = $ request -> getParam ( 'paging' ) [ $ modelClass ] ; if ( empty ( $ pagination ) ) { return ; } $ controller -> set ( '_pagination' , $ this -> _getJsonApiPaginationResponse ( $ pagination ) ) ; }
Appends the pagination information to the JSON or XML output

@param \Cake\Event\Event $event Event
@return void
Appends the pagination information to the JSON or XML output