PHP Class RainLab\Pages\Classes\Menu

Author: Alexey Bobkov, Samuel Georges
Inheritance: extends Cms\Classes\CmsObject
Afficher le fichier Open project: rainlab/pages-plugin Class Usage Examples

Protected Properties

Свойство Type Description
$allowedExtensions Allowable file extensions.
$contentDataCache Cache store used by parseContent method.
$defaultExtension Default file extension.
$dirName The container name associated with the model, eg: pages.
$fillable The attributes that are mass assignable.
$purgeable List of attribute names which are not considered "settings".

Méthodes publiques

Méthode Description
beforeSave ( ) : void Triggered before the menu is saved.
beforeValidate ( ) : void Validate custom attributes.
generateReferences ( Cms\Classes\Page $page ) : array Returns the menu item references.
getCodeAttribute ( ) : string Returns the menu code.
getItemDataAttribute ( ) : array Returns a default value for itemData attribute.
getItemsAttribute ( ) : array Returns a default value for items attribute.
getNameAttribute ( ) : string Returns a default value for name attribute.
initCacheItem ( &$item ) Initializes a cache item.
setCodeAttribute ( string $code ) : Cms\Classes\CmsObject Sets the menu code.

Méthodes protégées

Méthode Description
parseContent ( ) : array | null Processes the content attribute to an array of menu data.
renderContent ( ) : string Renders the menu data as a content string in YAML format.

Method Details

beforeSave() public méthode

Triggered before the menu is saved.
public beforeSave ( ) : void
Résultat void

beforeValidate() public méthode

Validate custom attributes.
public beforeValidate ( ) : void
Résultat void

generateReferences() public méthode

This function is used on the front-end.
public generateReferences ( Cms\Classes\Page $page ) : array
$page Cms\Classes\Page The current page object.
Résultat array Returns an array of the \RainLab\Pages\Classes\MenuItemReference objects.

getCodeAttribute() public méthode

Returns the menu code.
public getCodeAttribute ( ) : string
Résultat string

getItemDataAttribute() public méthode

Returns a default value for itemData attribute.
public getItemDataAttribute ( ) : array
Résultat array

getItemsAttribute() public méthode

Items are objects of the \RainLab\Pages\Classes\MenuItem class.
public getItemsAttribute ( ) : array
Résultat array

getNameAttribute() public méthode

Returns a default value for name attribute.
public getNameAttribute ( ) : string
Résultat string

initCacheItem() public static méthode

Initializes a cache item.
public static initCacheItem ( &$item )

parseContent() protected méthode

Processes the content attribute to an array of menu data.
protected parseContent ( ) : array | null
Résultat array | null

renderContent() protected méthode

Renders the menu data as a content string in YAML format.
protected renderContent ( ) : string
Résultat string

setCodeAttribute() public méthode

Sets the menu code.
public setCodeAttribute ( string $code ) : Cms\Classes\CmsObject
$code string Specifies the file code.
Résultat Cms\Classes\CmsObject Returns the object instance.

Property Details

$allowedExtensions protected_oe property

Allowable file extensions.
protected $allowedExtensions

$contentDataCache protected_oe property

Cache store used by parseContent method.
protected $contentDataCache

$defaultExtension protected_oe property

Default file extension.
protected $defaultExtension

$dirName protected_oe property

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

$fillable protected_oe property

The attributes that are mass assignable.
protected $fillable

$purgeable protected_oe property

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