PHP 클래스 RainLab\Pages\Classes\Snippet

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

공개 프로퍼티들

프로퍼티 타입 설명
$code Specifies the snippet code.

보호된 프로퍼티들

프로퍼티 타입 설명
$componentClass Snippet component class name.
$componentObj Snippet component object.
$description Specifies the snippet description.
$name Specifies the snippet name.
$pageSnippetMap Internal cache of snippet declarations defined on a page.
$properties Snippet properties.

공개 메소드들

메소드 설명
__construct ( )
clearMapCache ( Cms\Classes\Theme $theme ) Clears the snippet map item cache
extendPartialForm ( $formWidget ) Extends the partial form with Snippet fields.
getComponentClass ( ) : string Returns the snippet component class name.
getDescription ( ) : string Returns the snippet description.
getName ( ) : string Returns the snippet name.
getProperties ( ) Returns the snippet property list as array, in format compatible with Inspector.
initFromComponentInfo ( string $componentClass, string $componentCode ) Initializes the snippet from a CMS component information.
initFromPartial ( $partial ) Initializes the snippet from a CMS partial.
listPageComponents ( string $pageName, Cms\Classes\Theme $theme, $markup ) : array Returns a list of component definitions declared on the page.
processPageMarkup ( string $pageName, Cms\Classes\Theme $theme, string $markup ) : string Parses the static page markup and renders snippets defined on the page.
processTemplateSettings ( $template )
processTemplateSettingsArray ( $settingsArray )

보호된 메소드들

메소드 설명
dropDownOptionsToArray ( $optionsString )
dropDownOptionsToString ( $optionsArray )
extractSnippetsFromMarkup ( $markup, $theme )
extractSnippetsFromMarkupCached ( $theme, $pageName, $markup )
getComponent ( ) : Cms\Classes\ComponentBase Returns a component corresponding to the snippet.
getMapCacheKey ( $theme ) Returns a cache key for this record.
parseIniProperties ( $properties ) : array Converts a keyed object to an array, converting the index to the "property" value.
preprocessPropertyValues ( $theme, $snippetCode, $componentClass, $properties ) Apples default property values and fixes property names.

메소드 상세

__construct() 공개 메소드

public __construct ( )

clearMapCache() 공개 정적인 메소드

Clears the snippet map item cache
public static clearMapCache ( Cms\Classes\Theme $theme )
$theme Cms\Classes\Theme Specifies the current theme.

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

protected static dropDownOptionsToArray ( $optionsString )

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

protected static dropDownOptionsToString ( $optionsArray )

extendPartialForm() 공개 정적인 메소드

Extends the partial form with Snippet fields.
public static extendPartialForm ( $formWidget )

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

protected static extractSnippetsFromMarkup ( $markup, $theme )

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

protected static extractSnippetsFromMarkupCached ( $theme, $pageName, $markup )

getComponent() 보호된 메소드

This method should not be used in the front-end request handling code.
protected getComponent ( ) : Cms\Classes\ComponentBase
리턴 Cms\Classes\ComponentBase

getComponentClass() 공개 메소드

If the snippet is a partial snippet, returns NULL.
public getComponentClass ( ) : string
리턴 string Returns the snippet component class name

getDescription() 공개 메소드

This method should not be used in the front-end request handling.
public getDescription ( ) : string
리턴 string

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

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

getName() 공개 메소드

This method should not be used in the front-end request handling.
public getName ( ) : string
리턴 string

getProperties() 공개 메소드

Returns the snippet property list as array, in format compatible with Inspector.
public getProperties ( )

initFromComponentInfo() 공개 메소드

Initializes the snippet from a CMS component information.
public initFromComponentInfo ( string $componentClass, string $componentCode )
$componentClass string Specifies the component class.
$componentCode string Specifies the component code.

initFromPartial() 공개 메소드

Initializes the snippet from a CMS partial.
public initFromPartial ( $partial )

listPageComponents() 공개 정적인 메소드

Returns a list of component definitions declared on the page.
public static listPageComponents ( string $pageName, Cms\Classes\Theme $theme, $markup ) : array
$pageName string Specifies the static page file name (the name of the corresponding content block file).
$theme Cms\Classes\Theme Specifies a parent theme.
리턴 array Returns an array of component definitions

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

Converts a keyed object to an array, converting the index to the "property" value.
protected static parseIniProperties ( $properties ) : array
리턴 array

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

As snippet properties are defined with data attributes, they are lower case, whereas real property names are case sensitive. This method finds original property names defined in snippet classes or partials and replaces property names defined in the static page markup.
protected static preprocessPropertyValues ( $theme, $snippetCode, $componentClass, $properties )

processPageMarkup() 공개 정적인 메소드

Parses the static page markup and renders snippets defined on the page.
public static processPageMarkup ( string $pageName, Cms\Classes\Theme $theme, string $markup ) : string
$pageName string Specifies the static page file name (the name of the corresponding content block file).
$theme Cms\Classes\Theme Specifies a parent theme.
$markup string Specifies the markup string to process.
리턴 string Returns the processed string.

processTemplateSettings() 공개 정적인 메소드

public static processTemplateSettings ( $template )

processTemplateSettingsArray() 공개 정적인 메소드

public static processTemplateSettingsArray ( $settingsArray )

프로퍼티 상세

$code 공개적으로 프로퍼티

Specifies the snippet code.
public $code

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

Snippet component class name.
protected $componentClass

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

Snippet component object.
protected $componentObj

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

Specifies the snippet description.
protected $description

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

Specifies the snippet name.
protected $name

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

Internal cache of snippet declarations defined on a page.
protected static $pageSnippetMap

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

Snippet properties.
protected $properties