PHP 클래스 Yosymfony\Spress\Core\DataSource\Filesystem\AttributeParser

syntaxes supported: YAML and JSON.
저자: Victor Puertas ([email protected])
파일 보기 프로젝트 열기: spress/spress 1 사용 예제들

공개 메소드들

메소드 설명
__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.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( string $type = self::PARSER_YAML )
$type string Type of parser: "yaml" or "json"

getAttributesFromFrontmatter() 공개 메소드

e.g: (YAML syntax) --- name: "Victor" ---
public getAttributesFromFrontmatter ( string $value ) : array
$value string Frontmatter
리턴 array Array with two elements: "attributes" and "content"

getAttributesFromString() 공개 메소드

Get the attributes of an item from string.
public getAttributesFromString ( string $value ) : array
$value string Attributes represented as string. e.g: JSON or YAML
리턴 array

getContentFromFrontmatter() 공개 메소드

Get the content without frontmatter block.
public getContentFromFrontmatter ( string $value ) : string
$value string Frontmatter
리턴 string