Cecil

Converter implements ConverterInterface

Converter class.

This class implements the ConverterInterface and provides methods to convert front matter from various formats (YAML, INI, TOML, JSON) to an associative array, and to convert the body of content from Markdown to HTML.

Table of Contents

Interfaces

ConverterInterface
Converter interface.

Properties

$builder  : Builder

Methods

__construct()  : mixed
convertBody()  : string
Converts body.
convertFrontmatter()  : array<string|int, mixed>
Converts front matter.
convertIniToArray()  : array<string|int, mixed>
Converts INI string to array.
convertJsonToArray()  : array<string|int, mixed>
Converts JSON string to array.
convertTomlToArray()  : array<string|int, mixed>
Converts TOML string to array.
convertYamlToArray()  : array<string|int, mixed>
Converts YAML string to array.

Properties

Methods

convertBody()

Converts body.

public convertBody(string $string) : string
Parameters
$string : string
Return values
string

convertFrontmatter()

Converts front matter.

public convertFrontmatter(string $string[, string $format = 'yaml' ]) : array<string|int, mixed>
Parameters
$string : string
$format : string = 'yaml'
Tags
throws
RuntimeException
Return values
array<string|int, mixed>

convertIniToArray()

Converts INI string to array.

private static convertIniToArray(string $string) : array<string|int, mixed>
Parameters
$string : string
Tags
see
https://wikipedia.org/wiki/INI_file
Return values
array<string|int, mixed>

convertJsonToArray()

Converts JSON string to array.

private static convertJsonToArray(string $string) : array<string|int, mixed>
Parameters
$string : string
Tags
see
https://wikipedia.org/wiki/JSON
Return values
array<string|int, mixed>

convertTomlToArray()

Converts TOML string to array.

private static convertTomlToArray(string $string) : array<string|int, mixed>
Parameters
$string : string
Tags
see
https://wikipedia.org/wiki/TOML
Return values
array<string|int, mixed>

convertYamlToArray()

Converts YAML string to array.

private static convertYamlToArray(string $string) : array<string|int, mixed>
Parameters
$string : string
Tags
see
https://wikipedia.org/wiki/YAML
Return values
array<string|int, mixed>
 
On this page

Search results