I use a remote API to retrieve data (in xml, json format), which I'm caching. But I need to properly paginate this data before render.
I don't want to store this data in database.
I'm OK to recreate a PHPPaginator component and do the data manipulation by myself (Hash::sort, filtering, etc) like mentioned here but I would love to reuse the Pagination helper.
I tried to understand how the Paginator component transmits data to the Paginator helper but I couldn't find where it was instantiated and where the data was set.
I saw the $this->Paginator->settings gives for a classic model:
array(
'page' => (int) 1,
'current' => (int) 100,
'count' => (int) 341,
'prevPage' => false,
'nextPage' => true,
'pageCount' => (int) 4,
'order' => 'Model.created DESC',
'limit' => (int) 100,
'options' => array(),
'paramType' => 'named'
)
How should I instantiate the Paginator helper for it to autobuild all the links in the very same way as it does with normal data?