Documentation

PageInterface extends PageContentInterface, PageFormInterface, PageRoutableInterface, PageTranslateInterface, MediaInterface, PageLegacyInterface

Class implements page interface.

Table of Contents

Methods

active()  : bool
Returns whether or not this page is the currently active page requested via the URL.
activeChild()  : bool
Returns whether or not this URI's URL contains the URL of the active page.
addContentMeta()  : mixed
Add an entry to the page's contentMeta array
addForms()  : $this
Add forms to this page.
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
canonical()  : string
Returns the canonical URL for a 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.
content()  : string
Gets and Sets the content based on content portion of the .md file
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.
currentPosition()  : int|null
Returns the item in the current position.
date()  : int
Gets and sets the date for this Page object. This is typically passed in via the page headers
dateformat()  : string
Gets and sets the date format for this Page object. This is typically passed in via the page headers using typical PHP date string structure - http://php.net/manual/en/function.date.php
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
exists()  : bool
Returns whether the page exists in the filesystem.
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.
folder()  : string|null
Get/set the folder.
folderExists()  : bool
Returns whether or not the current folder exists
forms()  : array<string|int, mixed>
Alias of $this->getForms();
frontmatter()  : string
Gets and Sets the page frontmatter
getAction()  : string
Gets the action.
getBlueprint()  : Blueprint
Returns the blueprint from the page.
getContentMeta()  : mixed
Return the whole contentMeta array as it currently stands
getMedia()  : MediaCollectionInterface
Gets the associated media collection.
getMediaFolder()  : string|null
Get filesystem path to the associated media.
getMediaOrder()  : array<string|int, mixed>
Get display order for the associated media.
getOriginal()  : PageInterface
Gets the Page Unmodified (original) version of the page.
getRawContent()  : string
Needed by the onPageContentProcessed event to get the raw page content
header()  : stdClass|Header
Gets and Sets the header based on the YAML configuration at the top of the .md file
home()  : bool
Returns whether or not this page is the currently configured home page.
httpHeaders()  : array<string|int, mixed>
httpResponseCode()  : int
id()  : string
Gets and sets the identifier for this Page object.
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
isDir()  : bool
Returns whether or not this Page object is a directory or a page.
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.
isModule()  : bool
Returns true if page is a module.
isPage()  : bool
Returns whether or not this Page object has a .md file associated with it or if its just a directory.
language()  : mixed
Get page language
lastModified()  : bool
Gets and sets the option to show the last_modified header for the page.
link()  : string
Gets the URL for a page - alias of url().
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.
media()  : MediaCollectionInterface
Gets and sets the associated media as found in the page folder.
menu()  : string
Gets and sets the menu name for this Page. This is the text that can be used specifically for navigation.
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.
modified()  : int
Gets and sets the modified timestamp.
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.
order()  : string|bool
Get/set order number of this page.
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.
parent()  : PageInterface|null
Gets and Sets the parent object for this page
path()  : string|null
Gets and sets the path to the folder where the .md for this Page object resides.
permalink()  : string
Gets the URL with host information, aka Permalink.
prevSibling()  : PageInterface
Gets the previous sibling based on current position.
process()  : array<string|int, mixed>
Gets and Sets the process setup for this Page. This is multi-dimensional array that consists of a simple array of arrays with the form array("markdown"=>true) for example
publishDate()  : int
Gets and Sets the Page publish date
published()  : bool
Gets and Sets whether or not this Page is considered published
raw()  : string
Gets and Sets the raw data
rawMarkdown()  : string
Gets and Sets the Page raw content
rawRoute()  : string
Gets and Sets the page raw route
redirect()  : string
Gets the redirect set in the header.
relativePagePath()  : mixed
Returns the clean path to the page file
root()  : bool
Returns whether or not this page is the root node of the pages tree.
routable()  : bool
Gets and Sets whether or not this Page is routable, ie you can reach it via a URL.
route()  : string|null
Gets the route for the page based on the route headers if available, else from the parents route and the current Page's slug.
routeAliases()  : array<string|int, mixed>
Gets the route aliases for the page based on page headers.
routeCanonical()  : bool|string
Gets the canonical route for this page if its set. If provided it will use that value, else if it's `true` it will use the default route.
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
setRawContent()  : mixed
Needed by the onPageContentProcessed event to set the raw page content
setSummary()  : mixed
Sets the summary of the page
shouldProcess()  : bool
Gets the configured state of the processing method.
slug()  : string
Gets and Sets the slug for the Page. The slug is used in the URL routing. If not set it uses the parent folder from the path
ssl()  : bool
summary()  : string
Get the summary.
taxonomy()  : array<string|int, mixed>
Gets and sets the taxonomy array which defines which taxonomies this page identifies itself with.
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).
title()  : string
Gets and sets the title for this Page. If no title is set, it will use the slug() to get a name
toArray()  : array<string|int, mixed>
Convert page to an array.
toJson()  : string
Convert page to JSON encoded string.
topParent()  : PageInterface
Gets the top parent object for this page. Can return page itself.
toYaml()  : string
Convert page to YAML encoded string.
translated()  : bool
translatedLanguages()  : array<string|int, mixed>
Return an array with the routes of other translated languages
unpublishDate()  : int|null
Gets and Sets the Page unpublish date
unsetRouteSlug()  : mixed
Helper method to clear the route out so it regenerates next time you use it
untranslatedLanguages()  : array<string|int, mixed>
Return an array listing untranslated languages available
url()  : string
Gets the url for the Page.
urlExtension()  : string
Returns the page extension, got from the page `url_extension` config and falls back to the system config `system.pages.append_url_extension`.
validate()  : mixed
Validate page header.
value()  : mixed
Get value from a page variable (used mostly for creating edit forms).
visible()  : bool
Gets and Sets whether or not this Page is visible for navigation

Methods

active()

Returns whether or not this page is the currently active page requested via the URL.

public active() : bool
Return values
bool

True if it is active

activeChild()

Returns whether or not this URI's URL contains the URL of the active page.

public activeChild() : bool

Or in other words, is this page's URL in the current URL

Return values
bool

True if active child exists

addContentMeta()

Add an entry to the page's contentMeta array

public addContentMeta(string $name, mixed $value) : mixed
Parameters
$name : string
$value : mixed

addForms()

Add forms to this page.

public addForms(array<string|int, mixed> $new) : $this
Parameters
$new : array<string|int, mixed>
Return values
$this

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
string

cacheControl()

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|null

cachePageContent()

Fires the onPageContentProcessed event, and caches the page content using a unique ID for the page

public cachePageContent() : mixed

canonical()

Returns the canonical URL for a page

public canonical([bool $include_lang = true ]) : string
Parameters
$include_lang : bool = true
Return values
string

childType()

Returns child page type.

public childType() : string
Return values
string

collection()

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
throws
InvalidArgumentException
Return values
Collection

content()

Gets and Sets the content based on content portion of the .md file

public content([string|null $var = null ]) : string
Parameters
$var : string|null = null

Content

Return values
string

Content

contentMeta()

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
$this

currentPosition()

Returns the item in the current position.

public currentPosition() : int|null
Return values
int|null

The index of the current page.

date()

Gets and sets the date for this Page object. This is typically passed in via the page headers

public date([string|null $var = null ]) : int
Parameters
$var : string|null = null

New string representation of a date

Return values
int

Unix timestamp representation of the date

dateformat()

Gets and sets the date format for this Page object. This is typically passed in via the page headers using typical PHP date string structure - http://php.net/manual/en/function.date.php

public dateformat([string|null $var = null ]) : string
Parameters
$var : string|null = null

New string representation of a date format

Return values
string

String representation of a date format

debugger()

Returns the state of the debugger override etting for this page

public debugger() : bool
Return values
bool

eTag()

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

exists()

Returns whether the page exists in the filesystem.

public exists() : bool
Return values
bool

expires()

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|null

extra()

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|null

filePath()

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

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

folder()

Get/set the folder.

public folder([string|null $var = null ]) : string|null
Parameters
$var : string|null = null

New folder

Return values
string|null

The folder

folderExists()

Returns whether or not the current folder exists

public folderExists() : bool
Return values
bool

forms()

Alias of $this->getForms();

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
string

getAction()

Gets the action.

public getAction() : string
Return values
string

The Action string.

getBlueprint()

Returns the blueprint from the page.

public getBlueprint([string $name = '' ]) : Blueprint
Parameters
$name : string = ''

Name of the Blueprint form. Used by flex only.

Return values
Blueprint

Returns a Blueprint.

getContentMeta()

Return the whole contentMeta array as it currently stands

public getContentMeta([string|null $name = null ]) : mixed
Parameters
$name : string|null = null

getMediaFolder()

Get filesystem path to the associated media.

public getMediaFolder() : string|null
Return values
string|null

Media path or null if the object doesn't have media folder.

getMediaOrder()

Get display order for the associated media.

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

Empty array means default ordering.

getRawContent()

Needed by the onPageContentProcessed event to get the raw page content

public getRawContent() : string
Return values
string

the current page content

header()

Gets and Sets the header based on the YAML configuration at the top of the .md file

public header([object|array<string|int, mixed>|null $var = null ]) : stdClass|Header
Parameters
$var : object|array<string|int, mixed>|null = null

a YAML object representing the configuration for the file

Return values
stdClass|Header

The current YAML configuration

home()

Returns whether or not this page is the currently configured home page.

public home() : bool
Return values
bool

True if it is the homepage

httpHeaders()

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

id()

Gets and sets the identifier for this Page object.

public id([string|null $var = null ]) : string
Parameters
$var : string|null = null

New identifier

Return values
string

The identifier

inherited()

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
PageInterface

inheritedField()

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
$this

isDir()

Returns whether or not this Page object is a directory or a page.

public isDir() : bool
Return values
bool

True if its a directory

isFirst()

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

isModule()

Returns true if page is a module.

public isModule() : bool
Return values
bool

isPage()

Returns whether or not this Page object has a .md file associated with it or if its just a directory.

public isPage() : bool
Return values
bool

True if its a page with a .md file associated

language()

Get page language

public language([string|null $var = null ]) : mixed
Parameters
$var : string|null = null

lastModified()

Gets and sets the option to show the last_modified header for the page.

public lastModified([bool|null $var = null ]) : bool
Parameters
$var : bool|null = null

New last_modified header value

Return values
bool

Show last_modified header

Gets the URL for a page - alias of url().

public link([bool|null $include_host = false ]) : string
Parameters
$include_host : bool|null = false
Return values
string

the permalink

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

menu()

Gets and sets the menu name for this Page. This is the text that can be used specifically for navigation.

public menu([string|null $var = null ]) : string

If no menu field is set, it will use the title()

Parameters
$var : string|null = null

New menu field for the page

Return values
string

The menu field for the page

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

modified()

Gets and sets the modified timestamp.

public modified([int|null $var = null ]) : int
Parameters
$var : int|null = null

New modified unix timestamp

Return values
int

Modified unix timestamp

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
$this

name()

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.

order()

Get/set order number of this page.

public order([int|null $var = null ]) : string|bool
Parameters
$var : int|null = null

New order as a number

Return values
string|bool

Order in a form of '02.' or false if not set

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>

path()

Gets and sets the path to the folder where the .md for this Page object resides.

public path([string|null $var = null ]) : string|null

This is equivalent to the filePath but without the filename.

Parameters
$var : string|null = null

the path

Return values
string|null

the path

Gets the URL with host information, aka Permalink.

public permalink() : string
Return values
string

The permalink.

process()

Gets and Sets the process setup for this Page. This is multi-dimensional array that consists of a simple array of arrays with the form array("markdown"=>true) for example

public process([array<string|int, mixed>|null $var = null ]) : array<string|int, mixed>
Parameters
$var : array<string|int, mixed>|null = null

New array of name value pairs where the name is the process and value is true or false

Return values
array<string|int, mixed>

Array of name value pairs where the name is the process and value is true or false

publishDate()

Gets and Sets the Page publish date

public publishDate([string|null $var = null ]) : int
Parameters
$var : string|null = null

String representation of the new date

Return values
int

Unix timestamp representation of the date

published()

Gets and Sets whether or not this Page is considered published

public published([bool|null $var = null ]) : bool
Parameters
$var : bool|null = null

New value

Return values
bool

True if the page is published

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

rawMarkdown()

Gets and Sets the Page raw content

public rawMarkdown([string|null $var = null ]) : string
Parameters
$var : string|null = null
Return values
string

rawRoute()

Gets and Sets the page raw route

public rawRoute([string|null $var = null ]) : string
Parameters
$var : string|null = null
Return values
string

redirect()

Gets the redirect set in the header.

public redirect([string|null $var = null ]) : string
Parameters
$var : string|null = null

redirect url

Return values
string

relativePagePath()

Returns the clean path to the page file

public relativePagePath() : mixed

root()

Returns whether or not this page is the root node of the pages tree.

public root() : bool
Return values
bool

True if it is the root

routable()

Gets and Sets whether or not this Page is routable, ie you can reach it via a URL.

public routable([bool|null $var = null ]) : bool

The page must be routable and published

Parameters
$var : bool|null = null

true if the page is routable

Return values
bool

true if the page is routable

route()

Gets the route for the page based on the route headers if available, else from the parents route and the current Page's slug.

public route([string|null $var = null ]) : string|null
Parameters
$var : string|null = null

Set new default route.

Return values
string|null

The route for the Page.

routeAliases()

Gets the route aliases for the page based on page headers.

public routeAliases([array<string|int, mixed>|null $var = null ]) : array<string|int, mixed>
Parameters
$var : array<string|int, mixed>|null = null

list of route aliases

Return values
array<string|int, mixed>

The route aliases for the Page.

routeCanonical()

Gets the canonical route for this page if its set. If provided it will use that value, else if it's `true` it will use the default route.

public routeCanonical([string|null $var = null ]) : bool|string
Parameters
$var : string|null = null
Return values
bool|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>

setRawContent()

Needed by the onPageContentProcessed event to set the raw page content

public setRawContent(string|null $content) : mixed
Parameters
$content : string|null

setSummary()

Sets the summary of the page

public setSummary(string $summary) : mixed
Parameters
$summary : string

Summary

shouldProcess()

Gets the configured state of the processing method.

public shouldProcess(string $process) : bool
Parameters
$process : string

The process name, eg "twig" or "markdown"

Return values
bool

Whether or not the processing method is enabled for this Page

slug()

Gets and Sets the slug for the Page. The slug is used in the URL routing. If not set it uses the parent folder from the path

public slug([string|null $var = null ]) : string
Parameters
$var : string|null = null

New slug, e.g. 'my-blog'

Return values
string

The slug

ssl()

public ssl([bool|null $var = null ]) : bool
Parameters
$var : bool|null = null
Return values
bool

summary()

Get the summary.

public summary([int|null $size = null ][, bool $textOnly = false ]) : string
Parameters
$size : int|null = null

Max summary size.

$textOnly : bool = false

Only count text size.

Return values
string

taxonomy()

Gets and sets the taxonomy array which defines which taxonomies this page identifies itself with.

public taxonomy([array<string|int, mixed>|null $var = null ]) : array<string|int, mixed>
Parameters
$var : array<string|int, mixed>|null = null

New array of taxonomies

Return values
array<string|int, mixed>

An array of taxonomies

template()

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
string

title()

Gets and sets the title for this Page. If no title is set, it will use the slug() to get a name

public title([string|null $var = null ]) : string
Parameters
$var : string|null = null

New title of the Page

Return values
string

The title of the Page

toArray()

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
string

toYaml()

Convert page to YAML encoded string.

public toYaml() : string
Return values
string

translatedLanguages()

Return an array with the routes of other translated languages

public translatedLanguages([bool $onlyPublished = false ]) : array<string|int, mixed>
Parameters
$onlyPublished : bool = false

only return published translations

Return values
array<string|int, mixed>

the page translated languages

unpublishDate()

Gets and Sets the Page unpublish date

public unpublishDate([string|null $var = null ]) : int|null
Parameters
$var : string|null = null

String representation of the new date

Return values
int|null

Unix timestamp representation of the date

unsetRouteSlug()

Helper method to clear the route out so it regenerates next time you use it

public unsetRouteSlug() : mixed

untranslatedLanguages()

Return an array listing untranslated languages available

public untranslatedLanguages([bool $includeUnpublished = false ]) : array<string|int, mixed>
Parameters
$includeUnpublished : bool = false

also list unpublished translations

Return values
array<string|int, mixed>

the page untranslated languages

url()

Gets the url for the Page.

public url([bool $include_host = false ][, bool $canonical = false ][, bool $include_lang = true ][, bool $raw_route = false ]) : string
Parameters
$include_host : bool = false

Defaults false, but true would include http://yourhost.com

$canonical : bool = false

true to return the canonical URL

$include_lang : bool = true
$raw_route : bool = false
Return values
string

The url.

urlExtension()

Returns the page extension, got from the page `url_extension` config and falls back to the system config `system.pages.append_url_extension`.

public urlExtension() : string
Return values
string

The extension of this page. For example .html

value()

Get value from a page variable (used mostly for creating edit forms).

public value(string $name[, mixed|null $default = null ]) : mixed
Parameters
$name : string

Variable name.

$default : mixed|null = null

visible()

Gets and Sets whether or not this Page is visible for navigation

public visible([bool|null $var = null ]) : bool
Parameters
$var : bool|null = null

New value

Return values
bool

True if the page is visible


        
On this page

Search results