API Documentation

FrontMatter
in package
implements Stringable, SerializableContract uses Serializable

Object representing the YAML front matter of a Markdown file.

The data here is equal to the YAML. Unless you are using the data to construct dynamic data, you probably want to call the get() method on the Page object, as that will let you access dynamic computed data if it exists, or it will fall back to this class's data.

For package developers: Use $page->data('foo') to access page data + front matter Use $page->matter('foo') to access front matter only You can also get the front matter object using $page->matter (which is an instance of this class)

Tags
phpstan-consistent-constructor

Table of Contents

Interfaces

Stringable
SerializableContract
Specifies that a class can be serialized to an array and/or JSON.

Properties

$data  : array<string|int, mixed>

Methods

__construct()  : mixed
__get()  : mixed|array<string|int, mixed>
__toString()  : string
arraySerialize()  : array<string|int, mixed>
Recursively serialize Arrayables
fromArray()  : static
get()  : mixed|array<string|int, mixed>
has()  : bool
jsonSerialize()  : array<string|int, mixed>
set()  : static
toArray()  : array<string|int, mixed>
Get the instance as an array.
toJson()  : string
automaticallySerialize()  : array<string|int, mixed>
Automatically serialize all public properties.

Properties

Methods

__construct()

public __construct([array<string|int, mixed> $matter = [] ]) : mixed
Parameters
$matter : array<string|int, mixed> = []

__get()

public __get(string $key) : mixed|array<string|int, mixed>
Parameters
$key : string
Return values
mixed|array<string|int, mixed>

__toString()

public __toString() : string
Return values
string

arraySerialize()

Recursively serialize Arrayables

public arraySerialize() : array<string|int, mixed>
Return values
array<string|int, mixed>

fromArray()

public static fromArray(array<string|int, mixed> $matter) : static
Parameters
$matter : array<string|int, mixed>
Return values
static

get()

public get([string $key = null ][, mixed $default = null ]) : mixed|array<string|int, mixed>
Parameters
$key : string = null
$default : mixed = null
Return values
mixed|array<string|int, mixed>

has()

public has(string $key) : bool
Parameters
$key : string
Return values
bool

jsonSerialize()

public jsonSerialize() : array<string|int, mixed>
Tags
inheritDoc
Return values
array<string|int, mixed>

set()

public set(string $key, mixed $value) : static
Parameters
$key : string
$value : mixed
Return values
static

toArray()

Get the instance as an array.

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

toJson()

public toJson([int $options = 0 ]) : string
Parameters
$options : int = 0
Return values
string

automaticallySerialize()

Automatically serialize all public properties.

protected automaticallySerialize() : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results