Icon implements JsonSerializable
A url pointing to an icon URL or a base64-encoded data URI.
Tags
Table of Contents
Interfaces
- JsonSerializable
Properties
Methods
- __construct() : mixed
- fromArray() : self
- jsonSerialize() : IconData
Properties
$mimeType read-only
public
string|null
$mimeType
= null
$sizes read-only
public
array<string|int, mixed>|null
$sizes
= null
$src read-only
public
string
$src
Methods
__construct()
public
__construct(string $src[, string|null $mimeType = null ][, array<string|int, string>|null $sizes = null ]) : mixed
Parameters
- $src : string
-
a standard URI pointing to an icon resource
- $mimeType : string|null = null
-
optional override if the server's MIME type is missing or generic
- $sizes : array<string|int, string>|null = null
-
optional array of strings that specify sizes at which the icon can be used. Each string should be in WxH format (e.g.,
"48x48","96x96") or"any"for scalable formats like SVG.
fromArray()
public
static fromArray(IconData $data) : self
Parameters
- $data : IconData
Return values
selfjsonSerialize()
public
jsonSerialize() : IconData