How to get rendered image paths from the ElementAPI? I'm wanting to return HTML content via the ElementAPI. I seem to be able to do this with the following elements.php:

'endpoints' =&gt; [
    'api/trials.json' =&gt; [
        'elementType' =&gt; 'Entry',
        'criteria' =&gt; ['section' =&gt; 'trials'],
        'transformer' =&gt; function(EntryModel $entry) {
            return [
                'summary' =&gt; ($entry-&gt;summary ? $entry-&gt;summary-&gt;getRawContent() : false),
                ...
            ];
        },
    ]
]


It's just that the getRawContent() returns the following in the JSON:

"summary": "&lt;p&gt;&lt;img src=\"{asset:46:url}\"…


When I'm expecting:

"summary": "&lt;p&gt;&lt;img src=\"/images/myimage.png"…


Should I be using a different method to get to the content, or do I need to run the content through some kind of transformation?

Thanks in advance,

James
Rather than calling getRawContent(), just explicitly cast your Rich Text field data into a string:

'summary' =&gt; ($entry-&gt;summary ? (string) $entry-&gt;summary : false),