PHP Interface Yosymfony\Spress\Core\ContentManager\SiteAttribute\SiteAttributeInterface

e.g: "site.pages.page1". The site atributes is the array structure of attriutes used by your site.
Author: Victor Puertas ([email protected])
Exibir arquivo Open project: spress/spress

Public Methods

Method Description
addAttribute ( string $name, mixed $value ) Adds an attribute using "dot" notation if doesn't exists.
getAttribute ( string $name ) : mixed Get a value using "dot" notation.
getAttributes ( ) : array Gets the site attributes.
hasAttribute ( string $name ) : boolean Check if an attribute exists in using "dot" notation.
initialize ( array $attributes = [] ) Initializes the site attributes structure.
setAttribute ( string $name, mixed $value ) Set an attribute using "dot" notation.
setItem ( Yosymfony\Spress\Core\DataSource\ItemInterface $item ) Called in some phase of Spress's lifecycle: - invoqued to all items just before first spress.before_render_block event.

Method Details

addAttribute() public method

You can to escape a dot in a key surrendering with brackets: "[.]". e.g: $a->addAttribute('site.name', 'Spress site'); $a->addAttribute('site.pages.index[.]html', 'The content');
public addAttribute ( string $name, mixed $value )
$name string The name of the attribute
$value mixed The value of the attribute

getAttribute() public method

You can to escape a dot in a key surrendering with brackets: "[.]".
public getAttribute ( string $name ) : mixed
$name string
return mixed

getAttributes() public method

Gets the site attributes.
public getAttributes ( ) : array
return array The attributes

hasAttribute() public method

You can to escape a dot in a key surrendering with brackets: "[.]".
public hasAttribute ( string $name ) : boolean
$name string The name of the attribute
return boolean

initialize() public method

Initializes the site attributes structure.
public initialize ( array $attributes = [] )
$attributes array Initial attributes

setAttribute() public method

Set an attribute using "dot" notation.
public setAttribute ( string $name, mixed $value )
$name string The name of the attribute
$value mixed The value of the attribute

setItem() public method

- before and after of each spress.*_render_* event.
public setItem ( Yosymfony\Spress\Core\DataSource\ItemInterface $item )
$item Yosymfony\Spress\Core\DataSource\ItemInterface