Extension
in package
implements
ExtensionInterface
Class for mapping file extensions to MIME types.
Table of Contents
Interfaces
- ExtensionInterface
- Interface for Extension objects.
Properties
- $extension : string
- The file extension.
- $map : MimeMapInterface
- The MIME types map.
Methods
- __construct() : mixed
- Constructor.
- getDefaultType() : string
- Returns the file extension's preferred MIME type.
- getTypes() : array<int, string>
- Returns all the MIME types related to the file extension.
Properties
$extension read-only
The file extension.
protected
string
$extension
$map read-only
The MIME types map.
protected
MimeMapInterface
$map
Methods
__construct()
Constructor.
public
__construct(string $extension[, string|null $mapClass = null ]) : mixed
Parameters
- $extension : string
-
A file extension.
- $mapClass : string|null = null
-
(Optional) The FQCN of the map class to use.
getDefaultType()
Returns the file extension's preferred MIME type.
public
getDefaultType() : string
Return values
stringgetTypes()
Returns all the MIME types related to the file extension.
public
getTypes() : array<int, string>