SilverStripe\Assets\Storage\AssetContainer::setFromString
Assign a set of data to the backend
Signature
public function setFromString(string
$data,
string
$filename,
[string
$hash = NULL,
[string
$variant = NULL,
[array
$config = ]]] )
Parameters
$data
—
string
- Raw binary/text content
$filename
—
string
- Name for the resulting file
$hash
—
string
- Hash of original file, if storing a variant.
$variant
—
string
- Name of variant, if storing a variant.
$config
—
array
- Write options. {@see AssetStore}
Returns
- array
- Tuple associative array (Filename, Hash, Variant) Unless storing a variant, the hash
will be calculated from the given data.