php - Manual Pagination on data from api call which returns Object -
I'm new to Larwell and I'm working on a test project which will record some records by calling API via curl Will give . I was able to get an object and I'm ready to process it on my controller below:
$ results = app :: get_data ($ date); $ Task = Pageinator :: Creating ($ result-> Data, Count ($ result-> Data), 5); How do I manually get confused on manual pagination works, I have $ results-> data on 10 items and I already include that link. Printed on your footage but pointing to the page is not working. This type of manual paging works on the installation, I do not talk to the database, instead I am dragging data from a specific API call through the curl.
P>
User :: All () - & gt; Paginated ($ itemsPerPage);
To manually create a paginator, you have used it correctly, though, and it is not clearly documented, but Paginator :: create () automated As the form does not slice the array for you, you should manually do this manually (ie $ result value-> Data is an array).
$ itemsPerPage = 6; $ Current page = 2; $ SlicedResults = array_slice ($ result-> Data, $ itemsPerPage * $ currentPage, $ itemsPerPage); Paragator :: build ($ chopped result, $ total item, $ item refresh page); The above examples will give you 6 items from 3 pages.
Comments
Post a Comment