PHP Class RainLab\Pages\Classes\PageList

Author: Alexey Bobkov, Samuel Georges
Afficher le fichier Open project: rainlab/pages-plugin Class Usage Examples

Protected Properties

Свойство Type Description
$configCache
$theme

Méthodes publiques

Méthode Description
__construct ( Cms\Classes\Theme $theme ) Creates the page list object.
appendPage ( $page ) Appends page to the page hierarchy.
getPageParent ( Cms\Classes\Page $page ) Returns the parent name of the specified page.
getPageSubTree ( Cms\Classes\Page $page ) Returns a part of the page hierarchy starting from the specified page.
getPageTree ( boolean $skipCache = false ) : array Returns a list of top-level pages with subpages.
listPages ( boolean $skipCache = false ) : array Returns a list of static pages in the specified theme.
removeSubtree ( Cms\Classes\Page $page ) Removes a part of the page hierarchy starting from the specified page.
updateStructure ( array $structure ) Updates the page hierarchy structure in the theme's meta/static-pages.yaml file.

Méthodes protégées

Méthode Description
getConfigFilePath ( ) : string Returns an absolute path to the meta/static-pages.yaml file.
getPagesConfig ( ) : mixed Returns the parsed meta/static-pages.yaml file contents.

Method Details

__construct() public méthode

Creates the page list object.
public __construct ( Cms\Classes\Theme $theme )
$theme Cms\Classes\Theme Specifies a parent theme.

appendPage() public méthode

The page can be added to the end of the hierarchy or as a subpage to any existing page.
public appendPage ( $page )

getConfigFilePath() protected méthode

Returns an absolute path to the meta/static-pages.yaml file.
protected getConfigFilePath ( ) : string
Résultat string

getPageParent() public méthode

Returns the parent name of the specified page.
public getPageParent ( Cms\Classes\Page $page )
$page Cms\Classes\Page Specifies a page object.

getPageSubTree() public méthode

Returns a part of the page hierarchy starting from the specified page.
public getPageSubTree ( Cms\Classes\Page $page )
$page Cms\Classes\Page Specifies a page object.

getPageTree() public méthode

The method uses the theme's meta/static-pages.yaml file to build the hierarchy. The pages are returned in the order defined in the YAML file. The result of the method is used for building the back-end UI and for generating the menus.
public getPageTree ( boolean $skipCache = false ) : array
$skipCache boolean Indicates if objects should be reloaded from the disk bypassing the cache.
Résultat array Returns a nested array of objects: object('page': $pageObj, 'subpages'=>[...])

getPagesConfig() protected méthode

Returns the parsed meta/static-pages.yaml file contents.
protected getPagesConfig ( ) : mixed
Résultat mixed

listPages() public méthode

This method is used internally by the system.
public listPages ( boolean $skipCache = false ) : array
$skipCache boolean Indicates if objects should be reloaded from the disk bypassing the cache.
Résultat array Returns an array of static pages.

removeSubtree() public méthode

Removes a part of the page hierarchy starting from the specified page.
public removeSubtree ( Cms\Classes\Page $page )
$page Cms\Classes\Page Specifies a page object.

updateStructure() public méthode

Updates the page hierarchy structure in the theme's meta/static-pages.yaml file.
public updateStructure ( array $structure )
$structure array A nested associative array representing the page structure

Property Details

$configCache protected_oe static_oe property

protected static $configCache

$theme protected_oe property

protected $theme