SoPHIE API Documentation

Asset API Documentation

SoPHIE Asset API Class.

The Asset API provides media asset related functionality within a given
execution context.

Init: $assetApi = $api->get('sophie_asset');

Method: $assetApi->get(...)

Returns the raw asset data.

Parameters:

  • String $label

Returns Array

Method: $assetApi->inlineData(...)

Returns a base64 encoded asset to be used as inline data.

Parameters:

  • String $label

Returns String

Method: $assetApi->url(...)

Returns the url for an asset identified by the label.

Parameters:

  • String $label

Returns String

Method: $assetApi->inlineImg(...)

Returns an HTML IMG tag with inline asset data.

Returns an HTML IMG tag including the asset referenced by $label as inline data. $attribs is an associative array which is interpreted as additional attributes for the HTML IMG tag.

Parameters:

  • String $label
  • Array $attribs

Returns String

Method: $assetApi->img(...)

Returns an HTML IMG tag with the linked asset.

Returns an HTML IMG tag including the asset referenced by $label as the src link. $attribs is an associative array which is interpreted as additional attributes for the HTML IMG tag.

Parameters:

  • String $label
  • Array $attribs

Returns String