Summary
Wire content negotiation in AppController and include mixerapi/collection-view for automatic pagination metadata in collection responses.
Changes
- Add
viewClasses() to AppController returning JsonCollectionView (and optionally XmlCollectionView)
- Enable
.json/.xml extension parsing in config/routes.php
- Paginated responses automatically wrapped with metadata (
count, total, pages, next, prev) under a collection key, with data under data
New dependency
mixerapi/collection-view (individual package, not the umbrella)
Summary
Wire content negotiation in
AppControllerand includemixerapi/collection-viewfor automatic pagination metadata in collection responses.Changes
viewClasses()toAppControllerreturningJsonCollectionView(and optionallyXmlCollectionView).json/.xmlextension parsing inconfig/routes.phpcount,total,pages,next,prev) under acollectionkey, with data underdataNew dependency
mixerapi/collection-view(individual package, not the umbrella)