renderAsset()

Overview

public string function renderAsset(
      required string assetId
    ,          string context = "default"
    ,          struct args    = {}
)

Renders a given asset in an optional context. See Working with the asset manager for more detailed documentation on working with assets.

Arguments

NameTypeRequiredDescription
assetIdstringYesThe ID of the asset record to render
contextstringNo (default="default")The context in which the asset should be rendered. This will inform the choice of viewlet used to render the asset.
argsstructNo (default={})Arbitrary args struct to be passed to the viewlet that will render this asset