Метод | Описание | |
---|---|---|
__construct ( string $type = self::PARSER_YAML ) | Constructor. | |
getAttributesFromFrontmatter ( string $value ) : array | Get the attributes from the fronmatter of an item. Front-matter block let you specify certain attributes of the page and define new variables that will be available in the content. | |
getAttributesFromString ( string $value ) : array | Get the attributes of an item from string. | |
getContentFromFrontmatter ( string $value ) : string | Get the content without frontmatter block. |
public __construct ( string $type = self::PARSER_YAML ) | ||
$type | string | Type of parser: "yaml" or "json" |
public getAttributesFromFrontmatter ( string $value ) : array | ||
$value | string | Frontmatter |
Результат | array | Array with two elements: "attributes" and "content" |
public getAttributesFromString ( string $value ) : array | ||
$value | string | Attributes represented as string. e.g: JSON or YAML |
Результат | array |
public getContentFromFrontmatter ( string $value ) : string | ||
$value | string | Frontmatter |
Результат | string |