Documentation

DataURI
in package

Table of Contents

$charset  : mixed
$content  : mixed
$mimetype  : mixed
__construct()  : mixed
__toString()  : mixed
fromFile()  : DataURI
Data URI encoding is used to improve CSS performance when loading small images by embedding them directly into the CSS file itself, reducing the ammount of HTTP requests

Properties

Methods

__construct()

public __construct(mixed $content, mixed $mimetype[, mixed $charset = null ]) : mixed
Parameters
$content : mixed
$mimetype : mixed
$charset : mixed = null
Return values
mixed

__toString()

public __toString() : mixed
Return values
mixed

fromFile()

Data URI encoding is used to improve CSS performance when loading small images by embedding them directly into the CSS file itself, reducing the ammount of HTTP requests

public static fromFile(string $file) : DataURI

These saved requests are useful when the overhead of roughly 30% additional payload is negligible compared with the cost of a roundtrip. And they're also useful when the server is having issues responding (for example, the webserver is returning 404 / 500 pages for all requests - the served page should not be using any external resources from the same server).

Parameters
$file : string
Tags
throws
FileNotFoundException
Return values
DataURI

Search results