PHP Class RainLab\Pages\Classes\PageList

Author: Alexey Bobkov, Samuel Georges
Datei anzeigen Open project: rainlab/pages-plugin Class Usage Examples

Protected Properties

Property Type Description
$configCache
$theme

Public Methods

Method 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.

Protected Methods

Method 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 method

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

appendPage() public method

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

getConfigFilePath() protected method

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

getPageParent() public method

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

getPageSubTree() public method

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 method

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.
return array Returns a nested array of objects: object('page': $pageObj, 'subpages'=>[...])

getPagesConfig() protected method

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

listPages() public method

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.
return array Returns an array of static pages.

removeSubtree() public method

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 method

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