I have an application that consumes a webservice. My app send request to webservice like this:
Request example:
https://mywebservice.com/interesting-route/?page=4&limit=30
So I receive just a slice of result, not the complete array, else I could use ArrayAdapter to paginate in my controller. I wanna use just the twig extension to generate DOM elements in my views.
Response example:
{
results:
[
{
title: 'Nice title',
body: 'Nice body'
},
...,
{
title: 'Nice title',
body: 'Nice body'
},
],
total: 1350,
limit: 30
]
What's the way, maybe using FixedAdapter?
Thanks
As you say, the
FixedAdapter
should do what you need here. Here's some sample controller code you could adapt:Hope this helps.