Page
extends BaseEntity
in package
Page element
Represent a page with metadata associated and a frontend page available.
Tags
Table of Contents
Properties
- $directory : mixed
Methods
- __construct() : mixed
- Construct an element with an associated directory
- metadata() : mixed
- Return the metadata of the element
- metadata_fields() : array<string|int, mixed>
- Return the metadata fields of the page.
Properties
$directory
public
static mixed
$directory
Methods
__construct()
Construct an element with an associated directory
public
__construct(string $directory) : mixed
Parameters
- $directory : string
-
the path to the associated directory.
Tags
metadata()
Return the metadata of the element
public
metadata() : mixed
Every page metadata parse metadata like BaseEntity plus:
-
date
values in the metadata are parsed as timestamps.
Tags
Return values
mixed —The loaded json metadata file in appropriate PHP type.
metadata_fields()
Return the metadata fields of the page.
public
metadata_fields() : array<string|int, mixed>
Every page metadata inherit all the metadata of the BaseEntity plus:
-
date
: page publication date -
domain_url
: domain URL of the website (e.g."www.domain.com"
) -
relative_url
: relative URL if the page (e.g."/relative/url/to/page/"
) -
cover_img_src
: the page cover image src (e.g."www.domain.com/some/image.jpg"
)
Tags
Return values
array<string|int, mixed> —Names of the metadata fields of the element.