2

It occurred to me that in every case I was using Element API, I wanted a standardized way of requesting, as the only thing that needed to change was my transformers.

It seemed helpful to standardize the way the input requests were made, and rely solely on transformers for customization.

2

Here's what I came up with: https://gist.github.com/timkelty/8de8531df688b6ac08d2da0713b6ff00

This allows you to pass everything through request params, including specifying the transformer class.

Right now it looks for the transformer in the elementapi folder: plugins/elementapi/ElementApi_MyCustomThingTransformer.php

If a full-fledged CRUD API is baked into 3.0, I'm assuming this will be irrelevant by then.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.