PageLegacyInterface
in
Interface PageLegacyInterface
Table of Contents
Methods
- addContentMeta() : mixed
- Add an entry to the page's contentMeta array
- addForms() : mixed
- adjacentSibling() : PageInterface|false
- Returns the adjacent sibling based on a direction.
- ancestor() : PageInterface
- Helper method to return an ancestor page.
- blueprintName() : string
- Get the blueprint name for this page. Use the blueprint form field if set
- blueprints() : Blueprint
- Get blueprints for the page.
- cacheControl() : string|null
- Gets and sets the cache-control property. If not set it will return the default value (null) https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control for more details on valid options
- cachePageContent() : mixed
- Fires the onPageContentProcessed event, and caches the page content using a unique ID for the page
- children() : PageCollectionInterface|Collection
- Returns children of this page.
- childType() : string
- Returns child page type.
- collection() : Collection
- Get a collection of pages in the current context.
- contentMeta() : mixed
- Get the contentMeta array and initialize content first if it's not already
- copy() : $this
- Prepare a copy from the page. Copies also everything that's under the current page.
- debugger() : bool
- Returns the state of the debugger override etting for this page
- eTag() : bool
- Gets and sets the option to show the etag header for the page.
- evaluate() : PageCollectionInterface|Collection
- expires() : int
- Gets and sets the expires field. If not set will return the default
- extension() : string|null
- Gets and sets the extension field.
- extra() : array<string|int, mixed>
- Get unknown header variables.
- file() : MarkdownFile|null
- Get file object to the page.
- filePath() : string|null
- Gets and sets the path to the .md file for this Page object.
- filePathClean() : string
- Gets the relative path to the .md file
- filter() : mixed
- Filter page header from illegal contents.
- find() : PageInterface
- Helper method to return a page.
- folderExists() : bool
- Returns whether or not the current folder exists
- forms() : array<string|int, mixed>
- Returns normalized list of name => form pairs.
- frontmatter() : string
- Gets and Sets the page frontmatter
- getAction() : string
- Gets the action.
- getContentMeta() : mixed
- Return the whole contentMeta array as it currently stands
- getOriginal() : PageInterface
- Gets the Page Unmodified (original) version of the page.
- httpHeaders() : array<string|int, mixed>
- httpResponseCode() : int
- inherited() : PageInterface
- Helper method to return an ancestor page to inherit from. The current page object is returned.
- inheritedField() : array<string|int, mixed>
- Helper method to return an ancestor field only to inherit from. The first occurrence of an ancestor field will be returned if at all.
- init() : $this
- Initializes the page instance variables based on a file
- isFirst() : bool
- Check to see if this item is the first in an array of sub-pages.
- isLast() : bool
- Check to see if this item is the last in an array of sub-pages.
- maxCount() : int
- Gets and sets the maxCount field which describes how many sub-pages should be displayed if the sub_pages header property is set for this page object.
- metadata() : array<string|int, mixed>
- Function to merge page metadata tags and build an array of Metadata objects that can then be rendered in the page.
- modifyHeader() : mixed
- Modify a header value directly
- modular() : bool
- Gets and sets the modular var that helps identify this page is a modular child
- modularTwig() : bool
- Gets and sets the modular_twig var that helps identify this page as a modular child page that will need twig processing handled differently from a regular page.
- move() : $this
- Prepare move page to new location. Moves also everything that's under the current page.
- name() : string
- Gets and sets the name field. If no name field is set, it will return 'default.md'.
- nextSibling() : PageInterface
- Gets the next sibling based on current position.
- orderBy() : string
- Gets and sets the order by which the sub-pages should be sorted.
- orderDir() : string
- Gets and sets the order by which any sub-pages should be sorted.
- orderManual() : array<string|int, mixed>
- Gets the manual order set in the header.
- prevSibling() : PageInterface
- Gets the previous sibling based on current position.
- raw() : string
- Gets and Sets the raw data
- save() : mixed
- Save page if there's a file assigned to it.
- setContentMeta() : array<string|int, mixed>
- Sets the whole content meta array in one shot
- ssl() : bool
- template() : string
- Gets and sets the template field. This is used to find the correct Twig template file to render.
- templateFormat() : string
- Allows a page to override the output render format, usually the extension provided in the URL. (e.g. `html`, `json`, `xml`, etc).
- toArray() : array<string|int, mixed>
- Convert page to an array.
- toJson() : string
- Convert page to JSON encoded string.
- toYaml() : string
- Convert page to YAML encoded string.
- validate() : mixed
- Validate page header.
Methods
addContentMeta()
Add an entry to the page's contentMeta array
public
addContentMeta(string $name, mixed $value) : mixed
Parameters
- $name : string
- $value : mixed
addForms()
public
addForms(array<string|int, mixed> $new) : mixed
Parameters
- $new : array<string|int, mixed>
adjacentSibling()
Returns the adjacent sibling based on a direction.
public
adjacentSibling([int $direction = 1 ]) : PageInterface|false
Parameters
- $direction : int = 1
-
either -1 or +1
Return values
PageInterface|false —the sibling page
ancestor()
Helper method to return an ancestor page.
public
ancestor([bool|null $lookup = null ]) : PageInterface
Parameters
- $lookup : bool|null = null
-
Name of the parent folder
Return values
PageInterface —page you were looking for if it exists
blueprintName()
Get the blueprint name for this page. Use the blueprint form field if set
public
blueprintName() : string
Return values
stringblueprints()
Get blueprints for the page.
public
blueprints() : Blueprint
Return values
BlueprintcacheControl()
Gets and sets the cache-control property. If not set it will return the default value (null) https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control for more details on valid options
public
cacheControl([string|null $var = null ]) : string|null
Parameters
- $var : string|null = null
Return values
string|nullcachePageContent()
Fires the onPageContentProcessed event, and caches the page content using a unique ID for the page
public
cachePageContent() : mixed
children()
Returns children of this page.
public
children() : PageCollectionInterface|Collection
Return values
PageCollectionInterface|CollectionchildType()
Returns child page type.
public
childType() : string
Return values
stringcollection()
Get a collection of pages in the current context.
public
collection([string|array<string|int, mixed> $params = 'content' ][, bool $pagination = true ]) : Collection
Parameters
- $params : string|array<string|int, mixed> = 'content'
- $pagination : bool = true
Tags
Return values
CollectioncontentMeta()
Get the contentMeta array and initialize content first if it's not already
public
contentMeta() : mixed
copy()
Prepare a copy from the page. Copies also everything that's under the current page.
public
copy(PageInterface $parent) : $this
Returns a new Page object for the copy. You need to call $this->save() in order to perform the move.
Parameters
- $parent : PageInterface
-
New parent page.
Return values
$thisdebugger()
Returns the state of the debugger override etting for this page
public
debugger() : bool
Return values
booleTag()
Gets and sets the option to show the etag header for the page.
public
eTag([bool|null $var = null ]) : bool
Parameters
- $var : bool|null = null
-
show etag header
Return values
bool —show etag header
evaluate()
public
evaluate(string|array<string|int, mixed> $value[, bool $only_published = true ]) : PageCollectionInterface|Collection
Parameters
- $value : string|array<string|int, mixed>
- $only_published : bool = true
Return values
PageCollectionInterface|Collectionexpires()
Gets and sets the expires field. If not set will return the default
public
expires([int|null $var = null ]) : int
Parameters
- $var : int|null = null
-
The new expires value.
Return values
int —The expires value
extension()
Gets and sets the extension field.
public
extension([string|null $var = null ]) : string|null
Parameters
- $var : string|null = null
Return values
string|nullextra()
Get unknown header variables.
public
extra() : array<string|int, mixed>
Return values
array<string|int, mixed>file()
Get file object to the page.
public
file() : MarkdownFile|null
Return values
MarkdownFile|nullfilePath()
Gets and sets the path to the .md file for this Page object.
public
filePath([string|null $var = null ]) : string|null
Parameters
- $var : string|null = null
-
the file path
Return values
string|null —the file path
filePathClean()
Gets the relative path to the .md file
public
filePathClean() : string
Return values
string —The relative file path
filter()
Filter page header from illegal contents.
public
filter() : mixed
find()
Helper method to return a page.
public
find(string $url[, bool $all = false ]) : PageInterface
Parameters
- $url : string
-
the url of the page
- $all : bool = false
Return values
PageInterface —page you were looking for if it exists
folderExists()
Returns whether or not the current folder exists
public
folderExists() : bool
Return values
boolforms()
Returns normalized list of name => form pairs.
public
forms() : array<string|int, mixed>
Return values
array<string|int, mixed>frontmatter()
Gets and Sets the page frontmatter
public
frontmatter([string|null $var = null ]) : string
Parameters
- $var : string|null = null
Return values
stringgetAction()
Gets the action.
public
getAction() : string
Return values
string —The Action string.
getContentMeta()
Return the whole contentMeta array as it currently stands
public
getContentMeta([string|null $name = null ]) : mixed
Parameters
- $name : string|null = null
getOriginal()
Gets the Page Unmodified (original) version of the page.
public
getOriginal() : PageInterface
Return values
PageInterface —The original version of the page.
httpHeaders()
public
httpHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed>httpResponseCode()
public
httpResponseCode() : int
Return values
intinherited()
Helper method to return an ancestor page to inherit from. The current page object is returned.
public
inherited(string $field) : PageInterface
Parameters
- $field : string
-
Name of the parent folder
Return values
PageInterfaceinheritedField()
Helper method to return an ancestor field only to inherit from. The first occurrence of an ancestor field will be returned if at all.
public
inheritedField(string $field) : array<string|int, mixed>
Parameters
- $field : string
-
Name of the parent folder
Return values
array<string|int, mixed>init()
Initializes the page instance variables based on a file
public
init(SplFileInfo $file[, string|null $extension = null ]) : $this
Parameters
- $file : SplFileInfo
-
The file information for the .md file that the page represents
- $extension : string|null = null
Return values
$thisisFirst()
Check to see if this item is the first in an array of sub-pages.
public
isFirst() : bool
Return values
bool —True if item is first.
isLast()
Check to see if this item is the last in an array of sub-pages.
public
isLast() : bool
Return values
bool —True if item is last
maxCount()
Gets and sets the maxCount field which describes how many sub-pages should be displayed if the sub_pages header property is set for this page object.
public
maxCount([int|null $var = null ]) : int
Parameters
- $var : int|null = null
-
the maximum number of sub-pages
Return values
int —the maximum number of sub-pages
metadata()
Function to merge page metadata tags and build an array of Metadata objects that can then be rendered in the page.
public
metadata([array<string|int, mixed>|null $var = null ]) : array<string|int, mixed>
Parameters
- $var : array<string|int, mixed>|null = null
-
an Array of metadata values to set
Return values
array<string|int, mixed> —an Array of metadata values for the page
modifyHeader()
Modify a header value directly
public
modifyHeader(string $key, mixed $value) : mixed
Parameters
- $key : string
- $value : mixed
modular()
Gets and sets the modular var that helps identify this page is a modular child
public
modular([bool|null $var = null ]) : bool
Use ->isModule() or ->modularTwig() method instead.
Parameters
- $var : bool|null = null
-
true if modular_twig
Return values
bool —true if modular_twig
modularTwig()
Gets and sets the modular_twig var that helps identify this page as a modular child page that will need twig processing handled differently from a regular page.
public
modularTwig([bool|null $var = null ]) : bool
Parameters
- $var : bool|null = null
-
true if modular_twig
Return values
bool —true if modular_twig
move()
Prepare move page to new location. Moves also everything that's under the current page.
public
move(PageInterface $parent) : $this
You need to call $this->save() in order to perform the move.
Parameters
- $parent : PageInterface
-
New parent page.
Return values
$thisname()
Gets and sets the name field. If no name field is set, it will return 'default.md'.
public
name([string|null $var = null ]) : string
Parameters
- $var : string|null = null
-
The name of this page.
Return values
string —The name of this page.
nextSibling()
Gets the next sibling based on current position.
public
nextSibling() : PageInterface
Return values
PageInterface —the next Page item
orderBy()
Gets and sets the order by which the sub-pages should be sorted.
public
orderBy([string|null $var = null ]) : string
default - is the order based on the file system, ie 01.Home before 02.Advark title - is the order based on the title set in the pages date - is the order based on the date set in the pages folder - is the order based on the name of the folder with any numerics omitted
Parameters
- $var : string|null = null
-
supported options include "default", "title", "date", and "folder"
Return values
string —supported options include "default", "title", "date", and "folder"
orderDir()
Gets and sets the order by which any sub-pages should be sorted.
public
orderDir([string|null $var = null ]) : string
Parameters
- $var : string|null = null
-
the order, either "asc" or "desc"
Return values
string —the order, either "asc" or "desc"
orderManual()
Gets the manual order set in the header.
public
orderManual([string|null $var = null ]) : array<string|int, mixed>
Parameters
- $var : string|null = null
-
supported options include "default", "title", "date", and "folder"
Return values
array<string|int, mixed>prevSibling()
Gets the previous sibling based on current position.
public
prevSibling() : PageInterface
Return values
PageInterface —the previous Page item
raw()
Gets and Sets the raw data
public
raw([string|null $var = null ]) : string
Parameters
- $var : string|null = null
-
Raw content string
Return values
string —Raw content string
save()
Save page if there's a file assigned to it.
public
save([bool|mixed $reorder = true ]) : mixed
Parameters
- $reorder : bool|mixed = true
-
Internal use.
setContentMeta()
Sets the whole content meta array in one shot
public
setContentMeta(array<string|int, mixed> $content_meta) : array<string|int, mixed>
Parameters
- $content_meta : array<string|int, mixed>
Return values
array<string|int, mixed>ssl()
public
ssl([bool|null $var = null ]) : bool
Parameters
- $var : bool|null = null
Return values
booltemplate()
Gets and sets the template field. This is used to find the correct Twig template file to render.
public
template([string|null $var = null ]) : string
If no field is set, it will return the name without the .md extension
Parameters
- $var : string|null = null
-
the template name
Return values
string —the template name
templateFormat()
Allows a page to override the output render format, usually the extension provided in the URL. (e.g. `html`, `json`, `xml`, etc).
public
templateFormat([string|null $var = null ]) : string
Parameters
- $var : string|null = null
Return values
stringtoArray()
Convert page to an array.
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>toJson()
Convert page to JSON encoded string.
public
toJson() : string
Return values
stringtoYaml()
Convert page to YAML encoded string.
public
toYaml() : string
Return values
stringvalidate()
Validate page header.
public
validate() : mixed