FormatterInterface
extends
FileFormatterInterface
in
Defines common interface for all file formatters.
Use Grav\Framework\File\Interfaces\FileFormatterInterface instead
Table of Contents
Methods
- decode() : mixed
- Decode a string into data.
- encode() : string
- Encode data into a string.
- getDefaultFileExtension() : string
- Get default file extension from current formatter (with dot).
- getMimeType() : string
- getSupportedFileExtensions() : array<string|int, string>
- Get file extensions supported by current formatter (with dot).
Methods
decode()
Decode a string into data.
public
decode(string $data) : mixed
APIYes
Parameters
- $data : string
-
String to be decoded.
Return values
mixed —Returns decoded data.
encode()
Encode data into a string.
public
encode(mixed $data) : string
APIYes
Parameters
- $data : mixed
-
Data to be encoded.
Return values
string —Returns encoded data as a string.
getDefaultFileExtension()
Get default file extension from current formatter (with dot).
public
getDefaultFileExtension() : string
APIYes
Default file extension is the first defined extension.
Return values
string —Returns file extension (can be empty).
getMimeType()
public
getMimeType() : string
Tags
Return values
stringgetSupportedFileExtensions()
Get file extensions supported by current formatter (with dot).
public
getSupportedFileExtensions() : array<string|int, string>
APIYes
Return values
array<string|int, string> —Returns list of all supported file extensions.