PHP 클래스 RainLab\Pages\Classes\Page

저자: Alexey Bobkov, Samuel Georges
상속: extends Cms\Classes\Content
파일 보기 프로젝트 열기: rainlab/pages-plugin 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$attributeNames The array of custom attribute names.
$implement
$parentFileName Contains the page parent file name. This property is used by the page editor internally.
$rules The rules to be applied to the data.
$translatable Attributes that support translation, if available.
$translatableModel Translation model used for translation, if available.

보호된 프로퍼티들

프로퍼티 타입 설명
$childrenCache
$dirName The container name associated with the model, eg: pages.
$fillable Properties that can be set with fill()
$menuTreeCache
$parentCache
$processedBlockMarkupCache
$processedMarkupCache
$purgeable List of attribute names which are not considered "settings".
$wrapCode Wrap code section in PHP tags.

공개 메소드들

메소드 설명
__construct ( array $attributes = [] ) Creates an instance of the object and associates it with a CMS theme.
afterCreate ( ) Triggered after a new object is saved.
beforeCreate ( ) Triggered before a new object is saved.
beforeValidate ( ) Validates the object properties.
buildMenuTree ( Cms\Classes\Theme $theme ) : array Builds and caches a menu item tree.
clearMenuCache ( Cms\Classes\Theme $theme ) Clears the menu item cache
delete ( ) : array Deletes the object from the disk.
fill ( array $attributes ) Sets the object attributes.
getChildren ( ) : array Returns all the child pages that belong to this one.
getLayoutObject ( ) : Cms\Classes\Layout Looks up the Layout Cms object for this page.
getLayoutOptions ( ) : array Returns a list of layouts available in the theme.
getMenuTypeInfo ( string $type ) : array Handler for the pages.menuitem.getTypeInfo event.
getParent ( ) : mixed Returns the parent page that belongs to this one, or null.
getPlaceholdersAttribute ( ) : array Parses the page placeholder {% put %} tags and extracts the placeholder values.
getProcessedMarkup ( )
getProcessedPlaceholderMarkup ( $placeholderName, $placeholderContents )
getRichEditorTypeInfo ( string $type ) : array Handler for the backend.richeditor.getTypeInfo event.
getTwigContent ( ) Returns the Twig content string
initCmsComponents ( $cmsController ) Initializes CMS components associated with the page.
listLayoutPlaceholders ( ) : array Returns information about placeholders defined in the page layout.
listLayoutSyntaxFields ( )
resolveMenuItem ( RainLab\Pages\Classes\MenuItem $item, string $url, Cms\Classes\Theme $theme ) : mixed Handler for the pages.menuitem.resolveItem event.
setPlaceholdersAttribute ( array $value ) : void Takes an array of placeholder data (key: code, value: content) and renders it as a single string of Twig markup against the "code" attribute.
url ( $name ) : string Helper that makes a URL for a static page in the active theme.

보호된 메소드들

메소드 설명
appendToMeta ( ) Adds this page to the meta index.
flattenTwigNode ( $node ) : array Recursively flattens a twig node and children
generateFilenameFromCode ( ) * Generate a file name based on the URL
getMenuCacheKey ( $theme ) Returns a cache key for this record.
getValidationAttributes ( ) : array Returns the attributes used for validation.
listStaticPageMenuOptions ( ) : array Returns a list of options for the Reference drop-down menu in the menu item configuration form, when the Static Page item type is selected.
removeFromMeta ( ) Removes this page to the meta index.

메소드 상세

__construct() 공개 메소드

Creates an instance of the object and associates it with a CMS theme.
public __construct ( array $attributes = [] )
$attributes array

afterCreate() 공개 메소드

Triggered after a new object is saved.
public afterCreate ( )

appendToMeta() 보호된 메소드

Adds this page to the meta index.
protected appendToMeta ( )

beforeCreate() 공개 메소드

Triggered before a new object is saved.
public beforeCreate ( )

beforeValidate() 공개 메소드

Throws a ValidationException in case of an error.
public beforeValidate ( )

buildMenuTree() 공개 정적인 메소드

This method is used internally for menu items and breadcrumbs.
public static buildMenuTree ( Cms\Classes\Theme $theme ) : array
$theme Cms\Classes\Theme Specifies the current theme.
리턴 array Returns an array containing the page information

clearMenuCache() 공개 정적인 메소드

Clears the menu item cache
public static clearMenuCache ( Cms\Classes\Theme $theme )
$theme Cms\Classes\Theme Specifies the current theme.

delete() 공개 메소드

Recursively deletes subpages. Returns a list of file names of deleted pages.
public delete ( ) : array
리턴 array

fill() 공개 메소드

Sets the object attributes.
public fill ( array $attributes )
$attributes array A list of attributes to set.

flattenTwigNode() 보호된 메소드

Recursively flattens a twig node and children
protected flattenTwigNode ( $node ) : array
$node
리턴 array A flat array of twig nodes

generateFilenameFromCode() 보호된 메소드

* Generate a file name based on the URL
protected generateFilenameFromCode ( )

getChildren() 공개 메소드

Returns all the child pages that belong to this one.
public getChildren ( ) : array
리턴 array

getLayoutObject() 공개 메소드

Looks up the Layout Cms object for this page.
public getLayoutObject ( ) : Cms\Classes\Layout
리턴 Cms\Classes\Layout

getLayoutOptions() 공개 메소드

This method is used by the form widget.
public getLayoutOptions ( ) : array
리턴 array Returns an array of strings.

getMenuCacheKey() 보호된 정적인 메소드

Returns a cache key for this record.
protected static getMenuCacheKey ( $theme )

getMenuTypeInfo() 공개 정적인 메소드

Returns a menu item type information. The type information is returned as array with the following elements: - references - a list of the item type reference options. The options are returned in the ["key"] => "title" format for options that don't have sub-options, and in the format ["key"] => ["title"=>"Option title", "items"=>[...]] for options that have sub-options. Optional, required only if the menu item type requires references. - nesting - Boolean value indicating whether the item type supports nested items. Optional, false if omitted. - dynamicItems - Boolean value indicating whether the item type could generate new menu items. Optional, false if omitted. - cmsPages - a list of CMS pages (objects of the Cms\Classes\Page class), if the item type requires a CMS page reference to resolve the item URL.
public static getMenuTypeInfo ( string $type ) : array
$type string Specifies the menu item type
리턴 array Returns an array

getParent() 공개 메소드

Returns the parent page that belongs to this one, or null.
public getParent ( ) : mixed
리턴 mixed

getPlaceholdersAttribute() 공개 메소드

Parses the page placeholder {% put %} tags and extracts the placeholder values.
public getPlaceholdersAttribute ( ) : array
리턴 array Returns an associative array of the placeholder names and values.

getProcessedMarkup() 공개 메소드

public getProcessedMarkup ( )

getProcessedPlaceholderMarkup() 공개 메소드

public getProcessedPlaceholderMarkup ( $placeholderName, $placeholderContents )

getRichEditorTypeInfo() 공개 정적인 메소드

Returns a menu item type information. The type information is returned as array
public static getRichEditorTypeInfo ( string $type ) : array
$type string Specifies the page link type
리턴 array

getTwigContent() 공개 메소드

Returns the Twig content string
public getTwigContent ( )

getValidationAttributes() 보호된 메소드

Returns the attributes used for validation.
protected getValidationAttributes ( ) : array
리턴 array

initCmsComponents() 공개 메소드

Initializes CMS components associated with the page.
public initCmsComponents ( $cmsController )

listLayoutPlaceholders() 공개 메소드

Returns information about placeholders defined in the page layout.
public listLayoutPlaceholders ( ) : array
리턴 array Returns an associative array of the placeholder name and codes.

listLayoutSyntaxFields() 공개 메소드

listStaticPageMenuOptions() 보호된 정적인 메소드

Returns a list of options for the Reference drop-down menu in the menu item configuration form, when the Static Page item type is selected.
protected static listStaticPageMenuOptions ( ) : array
리턴 array Returns an array

removeFromMeta() 보호된 메소드

Removes this page to the meta index.
protected removeFromMeta ( )

resolveMenuItem() 공개 정적인 메소드

Returns information about a menu item. The result is an array with the following keys: - url - the menu item URL. Not required for menu item types that return all available records. The URL should be returned relative to the website root and include the subdirectory, if any. Use the Cms::url() helper to generate the URLs. - isActive - determines whether the menu item is active. Not required for menu item types that return all available records. - items - an array of arrays with the same keys (url, isActive, items) + the title key. The items array should be added only if the $item's $nesting property value is TRUE.
public static resolveMenuItem ( RainLab\Pages\Classes\MenuItem $item, string $url, Cms\Classes\Theme $theme ) : mixed
$item RainLab\Pages\Classes\MenuItem Specifies the menu item.
$url string Specifies the current page URL, normalized, in lower case The URL is specified relative to the website root, it includes the subdirectory name, if any.
$theme Cms\Classes\Theme Specifies the current theme.
리턴 mixed Returns an array. Returns null if the item cannot be resolved.

setPlaceholdersAttribute() 공개 메소드

Takes an array of placeholder data (key: code, value: content) and renders it as a single string of Twig markup against the "code" attribute.
public setPlaceholdersAttribute ( array $value ) : void
$value array
리턴 void

url() 공개 정적인 메소드

Guide for the page reference: - chairs -> content/static-pages/chairs.htm
public static url ( $name ) : string
리턴 string

프로퍼티 상세

$attributeNames 공개적으로 프로퍼티

The array of custom attribute names.
public $attributeNames

$childrenCache 보호되어 있는 프로퍼티

protected $childrenCache

$dirName 보호되어 있는 프로퍼티

The container name associated with the model, eg: pages.
protected $dirName

$fillable 보호되어 있는 프로퍼티

Properties that can be set with fill()
protected $fillable

$implement 공개적으로 프로퍼티

public $implement

$menuTreeCache 보호되어 있는 정적으로 프로퍼티

protected static $menuTreeCache

$parentCache 보호되어 있는 프로퍼티

protected $parentCache

$parentFileName 공개적으로 프로퍼티

Contains the page parent file name. This property is used by the page editor internally.
public $parentFileName

$processedBlockMarkupCache 보호되어 있는 프로퍼티

protected $processedBlockMarkupCache

$processedMarkupCache 보호되어 있는 프로퍼티

protected $processedMarkupCache

$purgeable 보호되어 있는 프로퍼티

List of attribute names which are not considered "settings".
protected $purgeable

$rules 공개적으로 프로퍼티

The rules to be applied to the data.
public $rules

$translatable 공개적으로 프로퍼티

Attributes that support translation, if available.
public $translatable

$translatableModel 공개적으로 프로퍼티

Translation model used for translation, if available.
public $translatableModel

$wrapCode 보호되어 있는 프로퍼티

Wrap code section in PHP tags.
protected $wrapCode