File::getDataUri(): string|null

In this article

Gets the data as a data URI for inline files.

Return

string|null The data URI in format: data:[mimeType];base64,[data], or null if not an inline file.

Source

public function getDataUri(): ?string
{
    if ($this->base64Data === null) {
        return null;
    }
    return sprintf('data:%s;base64,%s', $this->getMimeType(), $this->base64Data);
}

Changelog

VersionDescription
0.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.