Documentation

PageObject extends FlexPageObject uses FlexGravTrait, FlexObjectTrait, PageContentTrait, PageLegacyTrait, PageRoutableTrait, PageTranslateTrait

Class GravPageObject

Table of Contents

Constants

PAGE_ORDER_PREFIX_REGEX  = '/^[0-9]+\./u'
PAGE_ORDER_REGEX  = '/^(\d+)\.(.*)$/u'

Properties

$folder  : string
$name  : string
$order  : int|false
$route  : string
$slug  : string
$template  : string
$_content  : string|null
$_original  : array<string|int, mixed>|null
$_originalObject  : FlexPageObject|null
$_reorder  : array<string|int, mixed>|null
$_summary  : string|null
$_uploads  : array<string|int, mixed>
$calculatedProperties  : array<string|int, mixed>
$format  : string
$header  : object|null
$headerProperties  : array<string|int, mixed>
$language  : string
$root  : bool
$storage_key  : string|null
$storage_timestamp  : int|null
$type  : string
$_authors  : array<int, UserInterface>
$_content_meta  : array<string|int, mixed>|null
$_forms  : array<string|int, mixed>|null
$_initialized  : bool
$_key  : string
$_languages  : array<string|int, mixed>|null
$_metadata  : array<string|int, mixed>|null
$_parentCache  : PageInterface|null
$_path  : string|null
$_permissionsCache  : array<string|int, mixed>|null
$_route  : string|null
$_translations  : array<string|int, PageInterface>

Methods

__clone()  : mixed
Clone page.
__construct()  : mixed
Construct a new Flex Object instance.
__debugInfo()  : array<string|int, mixed>
__get()  : mixed
Returns the value at specified offset.
__isset()  : bool
Checks whether or not an offset exists.
__serialize()  : array<string|int, mixed>
__set()  : void
Assigns a value to the specified offset.
__toString()  : string
Returns a string representation of this object.
__unserialize()  : void
__unset()  : void
Magic method to unset the attribute
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()  : void
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|null
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
Alias of getBlueprint()
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()  : void
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
check()  : void
checkMediaFilename()  : void
children()  : FlexIndexInterface|PageCollectionInterface|Collection
Returns children of this page.
childType()  : string
Returns child page type.
collection()  : PageCollectionInterface|Collection
Get a collection of pages in the current context.
content()  : string
contentMeta()  : array<string|int, 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.
create()  : static
Create new object into the storage.
createCopy()  : FlexObjectInterface
createFromStorage()  : static
currentPosition()  : int|null
Returns the item in the current position.
date()  : int
dateformat()  : string|null
debugger()  : bool
Returns the state of the debugger override setting for this page
defNestedProperty()  : $this
defProperty()  : $this
delete()  : static
Delete object from the storage.
eTag()  : bool
Gets and sets the option to show the etag header for the page.
evaluate()  : PageCollectionInterface|Collection
exists()  : bool
Returns true if the object exists in the storage.
expires()  : int
Gets and sets the expires field. If not set will return the default
extension()  : string
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|null
Gets the relative path to the .md file
filter()  : void
Filter page header from illegal contents.
filterBy()  : bool
Filter page (true/false) by given filters.
find()  : PageInterface|null
Helper method to return a page.
findTranslation()  : string|null
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
full_order()  : string
getAction()  : string|null
Gets the action.
getAllLanguages()  : array<string|int, mixed>
getAuthors()  : array<int, UserInterface>
Get list of all author objects.
getBlueprint()  : Blueprint
Returns the blueprint of the object.
getCache()  : CacheInterface
getCacheChecksum()  : string
Get cache checksum for the object / collection.
getCachedMethods()  : array<string|int, mixed>
getCacheKey()  : string
Get a cache key which is used for caching the object / collection.
getChanges()  : array<string|int, mixed>
Get any changes from the object.
getContentMeta()  : string|array<string|int, mixed>|null
Return the whole contentMeta array as it currently stands
getCreated_Timestamp()  : int
getDefaultValue()  : mixed|null
Returns default value suitable to be used in a form for the given property.
getDefaultValues()  : array<string|int, mixed>
Returns default values suitable to be used in a form for the given property.
getDiff()  : array<string|int, mixed>
Get diff array from the object.
getFieldSettings()  : array<string|int, mixed>|null
getFlexDirectory()  : FlexDirectory
getFlexFeatures()  : array<string|int, mixed>
Get full list of features the object / collection implements.
getFlexKey()  : string
Get a unique key for the object.
getFlexType()  : string
Get Flex Type of the object / collection.
getForm()  : FlexFormInterface
Returns a form instance for the object.
getForms()  : array<string|int, mixed>
Return all the forms which are associated to this page.
getFormValue()  : mixed
Returns raw value suitable to be used in a form for the given property.
getKey()  : string
getLanguage()  : string
getLanguages()  : array<string|int, mixed>
Returns all translated languages.
getLevelListing()  : array<string|int, mixed>
getMasterKey()  : string
Get master storage key.
getMedia()  : MediaCollectionInterface
getMediaField()  : MediaCollectionInterface|null
getMediaFolder()  : string|null
getMediaOrder()  : array<string|int, mixed>
Get display order for the associated media.
getMetaData()  : array<string|int, mixed>
Get index data associated to the object.
getNestedProperty()  : mixed
getOriginal()  : FlexPageObject|null
Gets the Page Unmodified (original) version of the page.
getOriginalData()  : array<string|int, mixed>
Get original data before update
getPermissions()  : array<string|int, mixed>
getProperty()  : mixed
getPublish_Timestamp()  : int
getRawContent()  : string
getRoute()  : Route|null
getStorageFolder()  : string|null
getStorageKey()  : string
getTimestamp()  : int
Get last updated timestamp for the object / collection.
getTranslation()  : FlexObjectInterface|PageInterface|null
getType()  : string
getUnpublish_Timestamp()  : int|null
getUpdated_Timestamp()  : int
hasAuthor()  : bool
Returns true if object has the named author.
hasFlexFeature()  : bool
Test whether the feature is implemented in the object / collection.
hasKey()  : bool
hasNestedProperty()  : bool
hasProperty()  : bool
hasTranslation()  : bool
header()  : Header
home()  : bool
Returns whether or not this page is the currently configured home page.
httpHeaders()  : array<string|int, mixed>
httpResponseCode()  : int
id()  : string
inherited()  : PageInterface|null
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
initialize()  : void
isAuthorized()  : bool|null
Check if user is authorized for the action.
isDir()  : bool
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
isOrdered()  : bool
isPage()  : bool
isParentAuthorized()  : bool|null
isPublished()  : bool
isRoutable()  : bool
isVisible()  : bool
jsonSerialize()  : array<string|int, mixed>
language()  : string|null
Get page language
lastModified()  : bool
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()  : Media
menu()  : string
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
modifyHeader()  : void
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|false
Gets the next sibling based on current position.
offsetExists()  : bool
Whether or not an offset exists.
offsetGet()  : mixed
Returns the value at specified offset.
offsetSet()  : void
Assigns a value to the specified offset.
offsetUnset()  : void
Unsets an offset.
order()  : mixed
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
parentStorageKey()  : string|null
Get/set the folder.
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.
prepareStorage()  : array<string|int, mixed>
Prepare object for saving into the storage.
prevSibling()  : PageInterface|false
Gets the previous sibling based on current position.
process()  : array<string|int, mixed>
publishDate()  : int|null
published()  : bool
raw()  : string
Gets and Sets the raw data
rawMarkdown()  : string
rawRoute()  : string|null
Gets and Sets the page raw route
redirect()  : string|null
Gets the redirect set in the header.
refresh()  : bool
Refresh object from the storage.
relativePagePath()  : string|null
Returns the clean path to the page file
render()  : ContentBlockInterface|HtmlBlock
Renders the object.
resetMetadata()  : void
Reset the metadata and pull from header again
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()  : string|null
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()  : static
Save object into the storage.
search()  : float
Search a string from the object, returns weight between 0 and 1.
searchNestedProperty()  : float
searchProperty()  : float
setContentMeta()  : array<string|int, mixed>
Sets the whole content meta array in one shot
setFlexDirectory()  : void
setNestedProperty()  : $this
setProperty()  : $this
setRawContent()  : void
setStorageKey()  : $this
setSummary()  : void
setTimestamp()  : $this
shouldProcess()  : bool
slug()  : mixed
ssl()  : bool|null
storeOriginal()  : void
Store the Page Unmodified (original) version of the page.
summary()  : string
taxonomy()  : array<string|int, mixed>
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.
title()  : string
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
triggerEvent()  : $this
unpublishDate()  : int|null
unsetNestedProperty()  : $this
unsetProperty()  : $this
unsetRouteSlug()  : void
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
update()  : static
Updates object in the memory.
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()  : void
Validate page header.
value()  : mixed
visible()  : bool
addUpdatedMedia()  : void
buildMediaList()  : array<string|int, mixed>
buildMediaObject()  : MediaObject|UploadedMediaObject
createFormObject()  : FlexFormInterface
This methods allows you to override form objects in child classes.
createMedium()  : Medium|null
doGetBlueprint()  : Blueprint
doGetProperty()  : mixed
doHasProperty()  : bool
doSerialize()  : array<string|int, mixed>
doSetProperty()  : void
doUnserialize()  : void
doUnsetProperty()  : void
filterElements()  : void
Filter data coming to constructor or $this->update() request.
freeMedia()  : void
getActiveUser()  : UserInterface|null
getAuthorizeAction()  : string
getAuthorizeRule()  : string
getAuthorizeScope()  : string
getCollectionByProperty()  : FlexCollectionInterface<string|int, FlexObjectInterface>
getContainer()  : Grav
getElement()  : mixed|null
getElements()  : array<string|int, mixed>
getFallbackLanguages()  : array<string|int, mixed>
getFieldDateTime()  : DateTime|null
getFieldTimestamp()  : int|null
getFlexContainer()  : Flex
getInheritedParams()  : array<string|int, mixed>
Method that contains shared logic for inherited() and inheritedField()
getLanguageTemplates()  : array<string|int, mixed>
getMediaCache()  : CacheInterface
getMediaFields()  : array<string|int, mixed>
getRelatedDirectory()  : FlexDirectory
getStorage()  : array<string|int, mixed>
getTemplate()  : Template|TemplateWrapper
getTemplateConfig()  : array<string|int, mixed>
getTemplatePaths()  : array<string|int, mixed>
getTypePrefix()  : string
getUpdatedMedia()  : array<string, UploadedFileInterface|array<string|int, mixed>|null>
isAdminSite()  : bool
isAuthorizedAction()  : bool|null
Check if user is authorized for the action.
isAuthorizedByGroup()  : bool|null
Group authorization works as follows:
isAuthorizedOverride()  : bool|null
isAuthorizedSuperAdmin()  : bool|null
isMoved()  : bool
loadAuthors()  : array<int, UserInterface>
loadHeaderProperty()  : mixed|null
Common logic to load header properties.
loadPermissions()  : array<string|int, mixed>
loadProperty()  : mixed|null
Common logic to load header properties.
markAsCopy()  : void
normalizeForm()  : array<string|int, mixed>|null
offsetLoad_header()  : Header
offsetLoad_media()  : MediaCollectionInterface
offsetPrepare_header()  : Header
offsetSerialize_header()  : array<string|int, mixed>
offsetSerialize_media()  : null
onAfterSave()  : void
onBeforeSave()  : array<string|int, mixed>
onSave()  : array<string|int, mixed>
pageContentValue()  : mixed
parseFileProperty()  : array<string|int, mixed>|mixed
processContent()  : string
Gets and Sets the content based on content portion of the .md file
processMarkdown()  : string
Process the Markdown content.
processSummary()  : string
processTwig()  : string
Process the Twig page content.
reorderSiblings()  : PageCollection|null
resetBlueprints()  : void
Method to reset blueprints if the type changes.
routeInternal()  : string|null
saveUpdatedMedia()  : void
searchValue()  : float
setKey()  : $this
setMetaData()  : void
setStorage()  : void
setUpdatedMedia()  : void

Constants

PAGE_ORDER_PREFIX_REGEX

public mixed PAGE_ORDER_PREFIX_REGEX = '/^[0-9]+\./u'

PAGE_ORDER_REGEX

public mixed PAGE_ORDER_REGEX = '/^(\d+)\.(.*)$/u'

Properties

$_original

protected array<string|int, mixed>|null $_original

$calculatedProperties

protected static array<string|int, mixed> $calculatedProperties = ['name' => 'name', 'parent' => 'parent', 'parent_key' => 'parentStorageKey', 'folder' => 'folder', 'order' => 'order', 'template' => 'template']

$format

protected string $format

File format, eg. 'md'

$headerProperties

protected static array<string|int, mixed> $headerProperties = ['slug' => 'slug', 'routes' => false, 'title' => 'title', 'language' => 'language', 'template' => 'template', 'menu' => 'menu', 'routable' => 'routable', 'visible' => 'visible', 'redirect' => 'redirect', 'external_url' => false, 'order_dir' => 'orderDir', 'order_by' => 'orderBy', 'order_manual' => 'orderManual', 'dateformat' => 'dateformat', 'date' => 'date', 'markdown_extra' => false, 'taxonomy' => 'taxonomy', 'max_count' => 'maxCount', 'process' => 'process', 'published' => 'published', 'publish_date' => 'publishDate', 'unpublish_date' => 'unpublishDate', 'expires' => 'expires', 'cache_control' => 'cacheControl', 'etag' => 'eTag', 'last_modified' => 'lastModified', 'ssl' => 'ssl', 'template_format' => 'templateFormat', 'debugger' => false]

$language

protected string $language

Language code, eg: 'en'

$storage_timestamp

protected int|null $storage_timestamp

$_initialized

private bool $_initialized = false

$_permissionsCache

private array<string|int, mixed>|null $_permissionsCache

Methods

__clone()

Clone page.

public __clone() : mixed
Attributes
#[ReturnTypeWillChange]

__construct()

Construct a new Flex Object instance.

public __construct(array<string|int, mixed> $elements, mixed $key, FlexDirectory $directory[, bool $validate = false ]) : mixed
Parameters
$elements : array<string|int, mixed>

Array of object properties.

$key : mixed

Identifier key for the new object.

$directory : FlexDirectory

Flex Directory the object belongs into.

$validate : bool = false

True if the object should be validated against blueprint.

Tags
see
FlexObjectInterface::__construct()

__debugInfo()

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

__get()

Returns the value at specified offset.

public __get(mixed $offset) : mixed
Parameters
$offset : mixed

The offset to retrieve.

Attributes
#[ReturnTypeWillChange]
Return values
mixed

Can return all value types.

__isset()

Checks whether or not an offset exists.

public __isset(mixed $offset) : bool
Parameters
$offset : mixed

An offset to check for.

Attributes
#[ReturnTypeWillChange]
Return values
bool

Returns TRUE on success or FALSE on failure.

__serialize()

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

__set()

Assigns a value to the specified offset.

public __set(mixed $offset, mixed $value) : void
Parameters
$offset : mixed

The offset to assign the value to.

$value : mixed

The value to set.

Attributes
#[ReturnTypeWillChange]

__toString()

Returns a string representation of this object.

public __toString() : string
Attributes
#[ReturnTypeWillChange]
Return values
string

__unserialize()

public final __unserialize(array<string|int, mixed> $data) : void
Parameters
$data : array<string|int, mixed>

__unset()

Magic method to unset the attribute

public __unset(mixed $offset) : void
Parameters
$offset : mixed

The name value to unset

Attributes
#[ReturnTypeWillChange]

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, string $value) : void
Parameters
$name : string
$value : string

addForms()

Add forms to this page.

public addForms(array<string|int, mixed> $new[, bool $override = true ]) : $this
Parameters
$new : array<string|int, mixed>
$override : bool = true
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([string|null $lookup = null ]) : PageInterface|null
Parameters
$lookup : string|null = null

Name of the parent folder

Return values
PageInterface|null

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() : void

canonical()

Returns the canonical URL for a page

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

checkMediaFilename()

public checkMediaFilename(string $filename) : void

Use Media class that implements MediaUploadInterface instead.

Parameters
$filename : string

childType()

Returns child page type.

public childType() : string
Return values
string

content()

public content([mixed $var = null ]) : string
Parameters
$var : mixed = null
Tags
inheritdoc
throws
Exception
Return values
string

contentMeta()

Get the contentMeta array and initialize content first if it's not already

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

copy()

Prepare a copy from the page. Copies also everything that's under the current page.

public copy([PageInterface|null $parent = null ]) : $this

Returns a new Page object for the copy. You need to call $this->save() in order to perform the move.

Parameters
$parent : PageInterface|null = null

New parent page.

Return values
$this

create()

Create new object into the storage.

public create([string $key = null ]) : static
Parameters
$key : string = null

Optional new key. If key isn't given, random key will be associated to the object.

Tags
see
FlexObjectInterface::create()
Return values
static

createFromStorage()

public static createFromStorage(array<string|int, mixed> $elements, array<string|int, mixed> $storage, FlexDirectory $directory[, bool $validate = false ]) : static
Parameters
$elements : array<string|int, mixed>
$storage : array<string|int, mixed>
$directory : FlexDirectory
$validate : bool = false
Return values
static

currentPosition()

Returns the item in the current position.

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

the index of the current page.

date()

public date([mixed $var = null ]) : int
Parameters
$var : mixed = null
Tags
inheritdoc
Return values
int

dateformat()

public dateformat([mixed $var = null ]) : string|null
Parameters
$var : mixed = null
Tags
inheritdoc
Return values
string|null

debugger()

Returns the state of the debugger override setting for this page

public debugger() : bool
Return values
bool

defNestedProperty()

public defNestedProperty(string $property, mixed $default[, string|null $separator = null ]) : $this
Parameters
$property : string

Object property to be updated.

$default : mixed

Default value.

$separator : string|null = null

Separator, defaults to '.'

Tags
throws
RuntimeException
Return values
$this

defProperty()

public defProperty(string $property, mixed $default) : $this
Parameters
$property : string

Object property to be defined.

$default : mixed

Default value.

Return values
$this

delete()

Delete object from the storage.

public delete() : static
Return values
static

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 true if the object exists in the storage.

public exists() : bool
Tags
see
FlexObjectInterface::exists()
Return values
bool

Returns true if the object exists, false otherwise.

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
Parameters
$var : string|null = null
Return values
string

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|null
Return values
string|null

The relative file path

filter()

Filter page header from illegal contents.

public filter() : void

filterBy()

Filter page (true/false) by given filters.

public filterBy(array<string|int, mixed> $filters[, bool $recursive = false ]) : bool
  • search: string
  • extension: string
  • module: bool
  • visible: bool
  • routable: bool
  • published: bool
  • page: bool
  • translated: bool
Parameters
$filters : array<string|int, mixed>
$recursive : bool = false
Return values
bool

find()

Helper method to return a page.

public find(string $url[, bool $all = false ]) : PageInterface|null
Parameters
$url : string

the url of the page

$all : bool = false
Return values
PageInterface|null

page you were looking for if it exists

findTranslation()

public findTranslation([string|null $languageCode = null ][, bool|null $fallback = null ]) : string|null
Parameters
$languageCode : string|null = null
$fallback : bool|null = null
Return values
string|null

folder()

Get/set the folder.

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

Optional path, including numeric prefix.

Return values
string|null

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

full_order()

public full_order() : string
Return values
string

getAction()

Gets the action.

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

The Action string.

getAllLanguages()

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

If set to true, return separate entries for '' and 'en' (default) language.

Return values
array<string|int, mixed>

getBlueprint()

Returns the blueprint of the object.

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

Name of the Blueprint form. Used to create customized forms for different use cases.

Tags
see
FlexObjectInterface::getBlueprint()
Return values
Blueprint

Returns a Blueprint.

getCacheChecksum()

Get cache checksum for the object / collection.

public getCacheChecksum() : string
Tags
see
FlexObjectInterface::getCacheChecksum()
Return values
string

Returns cache checksum.

getCachedMethods()

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

getCacheKey()

Get a cache key which is used for caching the object / collection.

public getCacheKey() : string
Tags
see
FlexObjectInterface::getCacheKey()
Return values
string

Returns cache key.

getChanges()

Get any changes from the object.

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

getContentMeta()

Return the whole contentMeta array as it currently stands

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

getCreated_Timestamp()

public getCreated_Timestamp() : int
Return values
int

getDefaultValue()

Returns default value suitable to be used in a form for the given property.

public getDefaultValue(string $name[, string $separator = null ]) : mixed|null
Parameters
$name : string

Property name.

$separator : string = null

Optional nested property separator.

Tags
see
FlexObjectInterface::getDefaultValue()
Return values
mixed|null

Returns default value of the field, null if there is no default value.

getDefaultValues()

Returns default values suitable to be used in a form for the given property.

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

getDiff()

Get diff array from the object.

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

getFieldSettings()

public getFieldSettings(string $field) : array<string|int, mixed>|null
Parameters
$field : string
Return values
array<string|int, mixed>|null

getFlexFeatures()

Get full list of features the object / collection implements.

public getFlexFeatures() : array<string|int, mixed>
Tags
see
FlexCommonInterface::hasFlexFeature()
Return values
array<string|int, mixed>

getFlexType()

Get Flex Type of the object / collection.

public getFlexType() : string
Tags
see
FlexObjectInterface::getFlexType()
Return values
string

Returns Flex Type of the collection.

getForm()

Returns a form instance for the object.

public getForm([string $name = '' ][, array<string|int, mixed> $options = null ]) : FlexFormInterface
Parameters
$name : string = ''

Name of the form. Can be used to create customized forms for different use cases.

$options : array<string|int, mixed> = null

Options can be used to further customize the form.

Tags
see
FlexObjectInterface::getForm()
Return values
FlexFormInterface

Returns a Form.

getForms()

Return all the forms which are associated to this page.

public getForms() : array<string|int, mixed>

Forms are returned as [name => blueprint, ...], where blueprint follows the regular form blueprint format.

Return values
array<string|int, mixed>

getFormValue()

Returns raw value suitable to be used in a form for the given property.

public getFormValue(string $name[, mixed $default = null ][, string $separator = null ]) : mixed
Parameters
$name : string

Property name.

$default : mixed = null

Default value.

$separator : string = null

Optional nested property separator.

Tags
inheritdoc

PageInterface

Return values
mixed

Returns value of the field.

getKey()

public getKey() : string
Tags
see
ObjectInterface::getFlexKey()
Return values
string

getLanguages()

Returns all translated languages.

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

If set to true, return separate entries for '' and 'en' (default) language.

Return values
array<string|int, mixed>

getLevelListing()

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

getMediaFolder()

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

getMediaOrder()

Get display order for the associated media.

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

getMetaData()

Get index data associated to the object.

public getMetaData() : array<string|int, mixed>
Tags
see
FlexObjectInterface::getMetaData()
Return values
array<string|int, mixed>

Returns metadata of the object.

getNestedProperty()

public getNestedProperty(string $property[, mixed|null $default = null ][, string|null $separator = null ]) : mixed
Parameters
$property : string

Object property to be fetched.

$default : mixed|null = null

Default value if property has not been set.

$separator : string|null = null

Separator, defaults to '.'

Return values
mixed

Property value.

getOriginal()

Gets the Page Unmodified (original) version of the page.

public getOriginal() : FlexPageObject|null

Assumes that object has been cloned before modifying it.

Return values
FlexPageObject|null

The original version of the page.

getOriginalData()

Get original data before update

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

getPermissions()

public getPermissions([bool $inherit = false ]) : array<string|int, mixed>
Parameters
$inherit : bool = false
Return values
array<string|int, mixed>

getProperty()

public getProperty(string $property[, mixed $default = null ]) : mixed
Parameters
$property : string
$default : mixed = null

getPublish_Timestamp()

public getPublish_Timestamp() : int
Return values
int

getRawContent()

public getRawContent() : string
Tags
inheritdoc
Return values
string

getRoute()

public getRoute([string|array<string|int, mixed> $query = [] ]) : Route|null
Parameters
$query : string|array<string|int, mixed> = []
Return values
Route|null

getStorageFolder()

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

getStorageKey()

public abstract getStorageKey() : string
Return values
string

getTimestamp()

Get last updated timestamp for the object / collection.

public getTimestamp() : int
Tags
see
FlexObjectInterface::getTimestamp()
Return values
int

Returns Unix timestamp.

getType()

public getType([bool $prefix = false ]) : string

Use ->getFlexType() instead.

Parameters
$prefix : bool = false
Return values
string

getUnpublish_Timestamp()

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

getUpdated_Timestamp()

public getUpdated_Timestamp() : int
Return values
int

hasAuthor()

Returns true if object has the named author.

public hasAuthor(string $username) : bool
Parameters
$username : string
Return values
bool

hasFlexFeature()

Test whether the feature is implemented in the object / collection.

public hasFlexFeature(string $name) : bool
Parameters
$name : string
Tags
see
FlexCommonInterface::hasFlexFeature()
Return values
bool

hasNestedProperty()

public hasNestedProperty(string $property[, string|null $separator = null ]) : bool
Parameters
$property : string

Object property name.

$separator : string|null = null

Separator, defaults to '.'

Return values
bool

True if property has been defined (can be null).

hasProperty()

public hasProperty(string $property) : bool
Parameters
$property : string

Object property name.

Return values
bool

True if property has been defined (can be null).

hasTranslation()

public hasTranslation([string|null $languageCode = null ][, bool|null $fallback = null ]) : bool
Parameters
$languageCode : string|null = null
$fallback : bool|null = null
Return values
bool

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>

httpResponseCode()

public httpResponseCode() : int
Return values
int

id()

public id([mixed $var = null ]) : string
Parameters
$var : mixed = null
Tags
inheritdoc
Return values
string

inherited()

Helper method to return an ancestor page to inherit from. The current page object is returned.

public inherited(string $field) : PageInterface|null
Parameters
$field : string

Name of the parent folder

Return values
PageInterface|null

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

isAuthorized()

Check if user is authorized for the action.

public isAuthorized(string $action[, string|null $scope = null ][, UserInterface|null $user = null ]) : bool|null

Note: There are two deny values: denied (false), not set (null). This allows chaining multiple rules together when the previous rules were not matched.

To override the default behavior, please use isAuthorizedOverride().

Parameters
$action : string
$scope : string|null = null
$user : UserInterface|null = null
Tags
final
Return values
bool|null

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

isOrdered()

public isOrdered([bool $test = true ]) : bool
Parameters
$test : bool = true
Return values
bool

isPage()

public isPage([bool $bool = true ]) : bool
Parameters
$bool : bool = true
Tags
inheritdoc
Return values
bool

isParentAuthorized()

public isParentAuthorized(string $action[, string|null $scope = null ][, UserInterface|null $user = null ][, bool $isAuthor = false ]) : bool|null
Parameters
$action : string
$scope : string|null = null
$user : UserInterface|null = null
$isAuthor : bool = false
Return values
bool|null

isPublished()

public isPublished([bool $test = true ]) : bool
Parameters
$test : bool = true
Return values
bool

isRoutable()

public isRoutable([bool $test = true ]) : bool
Parameters
$test : bool = true
Return values
bool

isVisible()

public isVisible([bool $test = true ]) : bool
Parameters
$test : bool = true
Return values
bool

jsonSerialize()

public jsonSerialize() : array<string|int, mixed>
Attributes
#[ReturnTypeWillChange]
Return values
array<string|int, mixed>

language()

Get page language

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

lastModified()

public lastModified([mixed $var = null ]) : bool
Parameters
$var : mixed = null
Tags
inheritdoc
Return values
bool

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

public link([bool $include_host = false ]) : string
Parameters
$include_host : bool = 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()

public menu([mixed $var = null ]) : string
Parameters
$var : mixed = null
Tags
inheritdoc
Return values
string

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()

public modified([mixed $var = null ]) : int
Parameters
$var : mixed = null
Tags
inheritdoc
Return values
int

modifyHeader()

Modify a header value directly

public modifyHeader(string $key, string|array<string|int, mixed> $value) : void
Parameters
$key : string
$value : string|array<string|int, 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.

offsetExists()

Whether or not an offset exists.

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed

An offset to check for.

Attributes
#[ReturnTypeWillChange]
Return values
bool

Returns TRUE on success or FALSE on failure.

offsetGet()

Returns the value at specified offset.

public offsetGet(mixed $offset) : mixed
Parameters
$offset : mixed

The offset to retrieve.

Attributes
#[ReturnTypeWillChange]
Return values
mixed

Can return all value types.

offsetSet()

Assigns a value to the specified offset.

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed

The offset to assign the value to.

$value : mixed

The value to set.

Attributes
#[ReturnTypeWillChange]

offsetUnset()

Unsets an offset.

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed

The offset to unset.

Attributes
#[ReturnTypeWillChange]

order()

public order([mixed $var = null ]) : mixed
Parameters
$var : mixed = null
Tags
inheritdoc

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>

parentStorageKey()

Get/set the folder.

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

Optional path, including numeric prefix.

Return values
string|null

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.

prepareStorage()

Prepare object for saving into the storage.

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

process()

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

publishDate()

public publishDate([mixed $var = null ]) : int|null
Parameters
$var : mixed = null
Tags
inheritdoc
Return values
int|null

published()

public published([mixed $var = null ]) : bool
Parameters
$var : mixed = null
Tags
inheritdoc
Return values
bool

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()

public rawMarkdown([mixed $var = null ]) : string
Parameters
$var : mixed = null
Tags
inheritdoc
Return values
string

rawRoute()

Gets and Sets the page raw route

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

redirect()

Gets the redirect set in the header.

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

redirect url

Return values
string|null

refresh()

Refresh object from the storage.

public refresh([bool $keepMissing = false ]) : bool
Parameters
$keepMissing : bool = false
Return values
bool

True if the object was refreshed

relativePagePath()

Returns the clean path to the page file

public relativePagePath() : string|null

Needed in admin for Page Media.

Return values
string|null

render()

Renders the object.

public render([string $layout = null ][, array<string|int, mixed> $context = [] ]) : ContentBlockInterface|HtmlBlock
Parameters
$layout : string = null

Layout to be used.

$context : array<string|int, mixed> = []

Extra context given to the renderer.

Tags
see
FlexObjectInterface::render()
Return values
ContentBlockInterface|HtmlBlock

Returns HtmlBlock containing the rendered output.

resetMetadata()

Reset the metadata and pull from header again

public resetMetadata() : void

root()

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

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

save()

Save object into the storage.

public save([array<string|int, mixed>|bool $reorder = true ]) : static
Parameters
$reorder : array<string|int, mixed>|bool = true
Return values
static

Search a string from the object, returns weight between 0 and 1.

public search(string $search[, mixed $properties = null ][, array<string|int, mixed> $options = null ]) : float
Parameters
$search : string

Search string.

$properties : mixed = null

Properties to search for, defaults to configured properties.

$options : array<string|int, mixed> = null

Search options, defaults to configured options.

Tags
see
FlexObjectInterface::search()
Return values
float

Returns a weight between 0 and 1.

searchNestedProperty()

public searchNestedProperty(string $property, string $search[, array<string|int, mixed>|null $options = null ]) : float
Parameters
$property : string
$search : string
$options : array<string|int, mixed>|null = null
Return values
float

searchProperty()

public searchProperty(string $property, string $search[, array<string|int, mixed>|null $options = null ]) : float
Parameters
$property : string
$search : string
$options : array<string|int, mixed>|null = null
Return values
float

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>

setNestedProperty()

public setNestedProperty(string $property, mixed $value[, string|null $separator = null ]) : $this
Parameters
$property : string
$value : mixed
$separator : string|null = null
Return values
$this

setProperty()

public setProperty(string $property, mixed $value) : $this
Parameters
$property : string
$value : mixed
Return values
$this

setRawContent()

public setRawContent(mixed $content) : void
Parameters
$content : mixed
Tags
inheritdoc

setStorageKey()

public setStorageKey([string|null $key = null ]) : $this
Parameters
$key : string|null = null
Return values
$this

setSummary()

public setSummary(mixed $summary) : void
Parameters
$summary : mixed
Tags
inheritdoc

setTimestamp()

public setTimestamp([int $timestamp = null ]) : $this
Parameters
$timestamp : int = null
Return values
$this

shouldProcess()

public shouldProcess(mixed $process) : bool
Parameters
$process : mixed
Tags
inheritdoc
Return values
bool

slug()

public slug([mixed $var = null ]) : mixed
Parameters
$var : mixed = null
Tags
inheritdoc

ssl()

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

storeOriginal()

Store the Page Unmodified (original) version of the page.

public storeOriginal() : void

Can be called multiple times, only the first call matters.

summary()

public summary([mixed $size = null ][, mixed $textOnly = false ]) : string
Parameters
$size : mixed = null
$textOnly : mixed = false
Tags
inheritdoc
Return values
string

taxonomy()

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

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.

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

(e.g. html, json, xml, etc).

Parameters
$var : string|null = null
Return values
string

title()

public title([mixed $var = null ]) : string
Parameters
$var : mixed = null
Tags
inheritdoc
Return values
string

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

triggerEvent()

public triggerEvent(string $name[, object|null $event = null ]) : $this
Parameters
$name : string
$event : object|null = null
Return values
$this

unpublishDate()

public unpublishDate([mixed $var = null ]) : int|null
Parameters
$var : mixed = null
Tags
inheritdoc
Return values
int|null

unsetNestedProperty()

public unsetNestedProperty(string $property[, string|null $separator = null ]) : $this
Parameters
$property : string
$separator : string|null = null
Return values
$this

unsetProperty()

public unsetProperty(string $property) : $this
Parameters
$property : string

Object property to be unset.

Return values
$this

unsetRouteSlug()

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

public unsetRouteSlug() : void

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

update()

Updates object in the memory.

public update(array<string|int, mixed> $data[, array<string|int, mixed> $files = [] ]) : static
Parameters
$data : array<string|int, mixed>

Data containing updated properties with their values. To unset a value, use null.

$files : array<string|int, mixed> = []

List of uploaded files to be saved within the object.

Tags
see
FlexObjectInterface::update()
Return values
static

url()

Gets the url for the Page.

public url([bool $include_host = false ][, bool $canonical = false ][, bool $include_base = 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_base : 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

validate()

Validate page header.

public validate() : void
Tags
throws
Exception

value()

public abstract value(mixed $name[, mixed $default = null ][, mixed $separator = null ]) : mixed
Parameters
$name : mixed
$default : mixed = null
$separator : mixed = null
Tags
inheritdoc

Implement by calling:

$test = new \stdClass(); $value = $this->pageContentValue($name, $test); if ($value !== $test) { return $value; } return parent::value($name, $default);

visible()

public visible([mixed $var = null ]) : bool
Parameters
$var : mixed = null
Tags
inheritdoc
Return values
bool

buildMediaList()

protected buildMediaList(string|null $field) : array<string|int, mixed>
Parameters
$field : string|null
Return values
array<string|int, mixed>

createFormObject()

This methods allows you to override form objects in child classes.

protected createFormObject(string $name[, array<string|int, mixed>|null $options = null ]) : FlexFormInterface
Parameters
$name : string

Form name

$options : array<string|int, mixed>|null = null

Form optiosn

Return values
FlexFormInterface

doGetProperty()

protected & doGetProperty(string $property[, mixed $default = null ][, bool $doCreate = false ]) : mixed
Parameters
$property : string

Object property to be fetched.

$default : mixed = null

Default value if property has not been set.

$doCreate : bool = false
Return values
mixed

Property value.

doHasProperty()

protected doHasProperty(string $property) : bool
Parameters
$property : string

Object property name.

Return values
bool

True if property has been defined (can be null).

doSerialize()

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

doSetProperty()

protected doSetProperty(string $property, mixed $value) : void
Parameters
$property : string

Object property to be updated.

$value : mixed

New value.

doUnserialize()

protected doUnserialize(array<string|int, mixed> $serialized[, FlexDirectory|null $directory = null ]) : void
Parameters
$serialized : array<string|int, mixed>
$directory : FlexDirectory|null = null

doUnsetProperty()

protected doUnsetProperty(string $property) : void
Parameters
$property : string

Object property to be unset.

filterElements()

Filter data coming to constructor or $this->update() request.

protected filterElements(array<string|int, mixed> &$elements[, bool $extended = false ]) : void
Parameters
$elements : array<string|int, mixed>
$extended : bool = false

getAuthorizeAction()

protected getAuthorizeAction(string $action) : string
Parameters
$action : string
Return values
string

getAuthorizeRule()

protected getAuthorizeRule(string $scope, string $action) : string
Parameters
$scope : string
$action : string
Return values
string

getAuthorizeScope()

protected getAuthorizeScope() : string
Return values
string

getElement()

protected getElement(string $property[, mixed|null $default = null ]) : mixed|null
Parameters
$property : string
$default : mixed|null = null
Return values
mixed|null

getElements()

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

getFallbackLanguages()

protected getFallbackLanguages([string|null $languageCode = null ][, bool|null $fallback = null ]) : array<string|int, mixed>
Parameters
$languageCode : string|null = null
$fallback : bool|null = null
Return values
array<string|int, mixed>

getFieldDateTime()

protected getFieldDateTime(string $field) : DateTime|null
Parameters
$field : string
Return values
DateTime|null

getFieldTimestamp()

protected getFieldTimestamp(string $field) : int|null
Parameters
$field : string
Return values
int|null

getInheritedParams()

Method that contains shared logic for inherited() and inheritedField()

protected getInheritedParams(string $field) : array<string|int, mixed>
Parameters
$field : string

Name of the parent folder

Return values
array<string|int, mixed>

getLanguageTemplates()

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

getMediaFields()

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

getStorage()

protected getStorage() : array<string|int, mixed>

Use ->getMetaData() instead.

Return values
array<string|int, mixed>

getTemplate()

protected getTemplate(string $layout) : Template|TemplateWrapper

Moved to \Grav\Common\Flex\Traits\GravTrait

Parameters
$layout : string
Tags
throws
LoaderError
throws
SyntaxError
Return values
Template|TemplateWrapper

getTemplateConfig()

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

getTemplatePaths()

protected getTemplatePaths(string $layout) : array<string|int, mixed>
Parameters
$layout : string
Return values
array<string|int, mixed>

getTypePrefix()

protected getTypePrefix() : string
Return values
string

getUpdatedMedia()

protected getUpdatedMedia() : array<string, UploadedFileInterface|array<string|int, mixed>|null>
Return values
array<string, UploadedFileInterface|array<string|int, mixed>|null>

isAdminSite()

protected isAdminSite() : bool
Return values
bool

isAuthorizedAction()

Check if user is authorized for the action.

protected isAuthorizedAction(UserInterface $user, string $action, string $scope, bool $isMe) : bool|null
Parameters
$user : UserInterface
$action : string
$scope : string
$isMe : bool
Return values
bool|null

isAuthorizedByGroup()

Group authorization works as follows:

protected isAuthorizedByGroup(UserInterface $user, string $action, string $scope, bool $isMe, bool $isAuthor) : bool|null
  1. if any of the groups deny access, return false
  2. else if any of the groups allow access, return true
  3. else return null
Parameters
$user : UserInterface
$action : string
$scope : string
$isMe : bool
$isAuthor : bool
Return values
bool|null

isAuthorizedOverride()

protected isAuthorizedOverride(UserInterface $user, string $action, string $scope, bool $isMe) : bool|null
Parameters
$user : UserInterface
$action : string
$scope : string
$isMe : bool
Return values
bool|null

isMoved()

protected isMoved() : bool
Return values
bool

loadHeaderProperty()

Common logic to load header properties.

protected loadHeaderProperty(string $property, mixed $var, callable $filter) : mixed|null
Parameters
$property : string
$var : mixed
$filter : callable
Return values
mixed|null

loadPermissions()

protected loadPermissions([array<string|int, mixed> $parent = [] ]) : array<string|int, mixed>
Parameters
$parent : array<string|int, mixed> = []
Return values
array<string|int, mixed>

loadProperty()

Common logic to load header properties.

protected loadProperty(string $property, mixed $var, callable $filter) : mixed|null
Parameters
$property : string
$var : mixed
$filter : callable
Return values
mixed|null

normalizeForm()

protected normalizeForm(array<string|int, mixed>|null $form[, string|null $name = null ][, array<string|int, mixed> $rules = [] ]) : array<string|int, mixed>|null
Parameters
$form : array<string|int, mixed>|null
$name : string|null = null
$rules : array<string|int, mixed> = []
Return values
array<string|int, mixed>|null

offsetLoad_header()

protected offsetLoad_header(Header|stdClass|array<string|int, mixed>|null $value) : Header
Parameters
$value : Header|stdClass|array<string|int, mixed>|null
Return values
Header

offsetPrepare_header()

protected offsetPrepare_header(Header|stdClass|array<string|int, mixed>|null $value) : Header
Parameters
$value : Header|stdClass|array<string|int, mixed>|null
Return values
Header

offsetSerialize_header()

protected offsetSerialize_header(Header|null $value) : array<string|int, mixed>
Parameters
$value : Header|null
Return values
array<string|int, mixed>

offsetSerialize_media()

protected offsetSerialize_media() : null
Return values
null

onAfterSave()

protected onAfterSave(array<string|int, mixed> $variables) : void
Parameters
$variables : array<string|int, mixed>

onBeforeSave()

protected onBeforeSave(array<string|int, mixed> $variables) : array<string|int, mixed>
Parameters
$variables : array<string|int, mixed>
Return values
array<string|int, mixed>

onSave()

protected onSave(array<string|int, mixed> $variables) : array<string|int, mixed>
Parameters
$variables : array<string|int, mixed>
Return values
array<string|int, mixed>

pageContentValue()

protected pageContentValue(string $name[, mixed|null $default = null ]) : mixed
Parameters
$name : string
$default : mixed|null = null

parseFileProperty()

protected parseFileProperty(array<string|int, mixed>|mixed $value[, array<string|int, mixed> $settings = [] ]) : array<string|int, mixed>|mixed
Parameters
$value : array<string|int, mixed>|mixed
$settings : array<string|int, mixed> = []
Return values
array<string|int, mixed>|mixed

processContent()

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

protected processContent(string $content) : string
Parameters
$content : string
Tags
throws
Exception
Return values
string

processMarkdown()

Process the Markdown content.

protected processMarkdown(string $content[, array<string|int, mixed> $options = [] ]) : string

Uses Parsedown or Parsedown Extra depending on configuration.

Parameters
$content : string
$options : array<string|int, mixed> = []
Tags
throws
Exception
Return values
string

processSummary()

protected processSummary([int|null $size = null ][, bool $textOnly = false ]) : string
Parameters
$size : int|null = null
$textOnly : bool = false
Return values
string

processTwig()

Process the Twig page content.

protected processTwig(string $content) : string
Parameters
$content : string
Return values
string

reorderSiblings()

protected reorderSiblings(array<string|int, mixed> $ordering) : PageCollection|null
Parameters
$ordering : array<string|int, mixed>
Tags
phpstan-return

ObjectCollection<string,PageObject>|null

Return values
PageCollection|null

resetBlueprints()

Method to reset blueprints if the type changes.

protected resetBlueprints() : void
Tags
since
1.7.18

routeInternal()

protected routeInternal() : string|null
Return values
string|null

searchValue()

protected searchValue(string $name, mixed $value, string $search[, array<string|int, mixed>|null $options = null ]) : float
Parameters
$name : string
$value : mixed
$search : string
$options : array<string|int, mixed>|null = null
Return values
float

setKey()

protected setKey(string $key) : $this
Parameters
$key : string
Return values
$this

setMetaData()

protected setMetaData(array<string|int, mixed> $meta) : void
Parameters
$meta : array<string|int, mixed>

setStorage()

protected setStorage(array<string|int, mixed> $storage) : void

Use ->setMetaData() instead.

Parameters
$storage : array<string|int, mixed>

setUpdatedMedia()

protected setUpdatedMedia(array<string|int, mixed> $files) : void
Parameters
$files : array<string|int, mixed>

        
On this page

Search results