I'm trying to use the Imager-Craft plugin to make specific image transformations, but cannot figure out how to access Imager within the element-api.php
file.
Imager shows plenty of template examples, but I'm not sure how to translate template code like this into straight Element API php.
{% set image = craft.assets().one() %}
{% set transformedImage = craft.imager.transformImage(image, { width: 1000 }) %}
<img src="{{ transformedImage.url }}">```
Specifically, I'm trying to access that craft.imager.transformImage
function.
Is this possible?
craft()->plugins->getPlugin('Imager')
, but this doesn't seem to work in Craft 3 with Element API v2. I there a v2 equivalent?