PHP Class RainLab\Pages\Classes\SnippetManager

Author: Alexey Bobkov, Samuel Georges
Inheritance: use trait October\Rain\Support\Traits\Singleton
显示文件 Open project: rainlab/pages-plugin Class Usage Examples

Protected Properties

Property Type Description
$snippets

Public Methods

Method Description
clearCache ( Cms\Classes\Theme $theme ) Clears front-end run-time cache.
findByCodeOrComponent ( Cms\Classes\Theme $theme, string $code, $componentClass, boolean $allowCaching = false ) : array Finds a snippet by its code.
getPartialSnippetMap ( Cms\Classes\Theme $theme ) : Returns Returns a list of partial-based snippets and corresponding partial names.
listSnippets ( Cms\Classes\Theme $theme ) : array Returns a list of available snippets.

Protected Methods

Method Description
getPartialMapCacheKey ( $theme ) Returns a cache key for this record.
listComponentSnippets ( ) : array Returns a list of snippets created from components.
listThemeSnippets ( Cms\Classes\Theme $theme ) : array Returns a list of snippets in the specified theme.

Method Details

clearCache() public static method

Clears front-end run-time cache.
public static clearCache ( Cms\Classes\Theme $theme )
$theme Cms\Classes\Theme Specifies a parent theme.

findByCodeOrComponent() public method

This method is used internally by the system.
public findByCodeOrComponent ( Cms\Classes\Theme $theme, string $code, $componentClass, boolean $allowCaching = false ) : array
$theme Cms\Classes\Theme Specifies a parent theme.
$code string Specifies the snippet code.
$allowCaching boolean Specifies whether caching is allowed for the call.
return array Returns an array of Snippet objects.

getPartialMapCacheKey() protected static method

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

getPartialSnippetMap() public method

Returns a list of partial-based snippets and corresponding partial names.
public getPartialSnippetMap ( Cms\Classes\Theme $theme ) : Returns
$theme Cms\Classes\Theme Specifies a parent theme.
return Returns an associative array with the snippet code in keys and partial file names in values.

listComponentSnippets() protected method

Returns a list of snippets created from components.
protected listComponentSnippets ( ) : array
return array Returns an array of Snippet objects.

listSnippets() public method

Returns a list of available snippets.
public listSnippets ( Cms\Classes\Theme $theme ) : array
$theme Cms\Classes\Theme Specifies a parent theme.
return array Returns an unsorted array of snippet objects.

listThemeSnippets() protected method

Returns a list of snippets in the specified theme.
protected listThemeSnippets ( Cms\Classes\Theme $theme ) : array
$theme Cms\Classes\Theme Specifies a parent theme.
return array Returns an array of Snippet objects.

Property Details

$snippets protected_oe property

protected $snippets