Documentation

PageContentInterface

Methods currently implemented in Flex Page emulation layer.

Table of Contents

Methods

content()  : string
Gets and Sets the content based on content portion of the .md file
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
exists()  : bool
Returns whether the page exists in the filesystem.
folder()  : string|null
Get/set the folder.
getBlueprint()  : Blueprint
Returns the blueprint from 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
id()  : string
Gets and sets the identifier for this Page object.
isDir()  : bool
Returns whether or not this Page object is a directory or a page.
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.
lastModified()  : bool
Gets and sets the option to show the last_modified header for the page.
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.
modified()  : int
Gets and sets the modified timestamp.
order()  : string|bool
Get/set order number of this page.
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
rawMarkdown()  : string
Gets and Sets the Page raw content
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
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.
title()  : string
Gets and sets the title for this Page. If no title is set, it will use the slug() to get a name
unpublishDate()  : int|null
Gets and Sets the Page unpublish date
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

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

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

exists()

Returns whether the page exists in the filesystem.

public exists() : bool
Return values
bool

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

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.

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

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

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

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

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

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

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

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

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

rawMarkdown()

Gets and Sets the Page raw content

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

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

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

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

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

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