PHP Class App\Source\Composite\Menu

Inheritance: extends AMenu
Datei anzeigen Open project: andrey900/slimcms

Public Methods

Method Description
add ( App\Source\Composite\Interfaces\IMenuComposite $menuItem )
attributes ( $arAttr = null, $value = null ) : string | Item Set or get items's attributes
clearFilter ( )
extractAttr ( array $options ) : array Extract valid html attributes from user's options
filter ( callable $callback ) : Menu Filter menu items by user callback
getAllItems ( )
getChild ( integer $id = false )
getParent ( $id )
getUrl ( array | string $options ) : string Return url
length ( ) : integer Count number of items in the menu
meta ( $arData = null, $value = null ) : string | MenuItem Set or get items's meta data
remove ( $id )
sortByMeta ( $metaName )

Method Details

add() public method

public add ( App\Source\Composite\Interfaces\IMenuComposite $menuItem )
$menuItem App\Source\Composite\Interfaces\IMenuComposite

attributes() public method

Set or get items's attributes
public attributes ( $arAttr = null, $value = null ) : string | Item
return string | Item

clearFilter() public method

public clearFilter ( )

extractAttr() public method

Extract valid html attributes from user's options
public extractAttr ( array $options ) : array
$options array
return array

filter() public method

Filter menu items by user callback
public filter ( callable $callback ) : Menu
$callback callable
return Menu

getAllItems() public method

public getAllItems ( )

getChild() public method

public getChild ( integer $id = false )
$id integer

getParent() public method

public getParent ( $id )
$id

getUrl() public method

Return url
public getUrl ( array | string $options ) : string
$options array | string
return string

length() public method

Count number of items in the menu
public length ( ) : integer
return integer

meta() public method

Set or get items's meta data
public meta ( $arData = null, $value = null ) : string | MenuItem
return string | MenuItem

remove() public method

public remove ( $id )
$id

sortByMeta() public method

public sortByMeta ( $metaName )