Tree

Menu Tree class to represent a menu tree hierarchy

deprecated
since

3.8.0

deprecated

4.0 Use Joomla\CMS\Menu\MenuItem

Methods

__construct

Constructor

__construct() 
deprecated
since

3.8.0

deprecated

4.0 Use Joomla\CMS\Menu\MenuItem

addChild

Method to add a child

addChild(\Joomla\CMS\Menu\Node $node, boolean $setCurrent = false) : \Joomla\CMS\Menu\Node
deprecated
since

3.8.0

deprecated

4.0 Use Joomla\CMS\Menu\MenuItem

Arguments

$node

\Joomla\CMS\Menu\NodeThe node to process

$setCurrent

booleanSet this new child as the current node for further working

Response

\Joomla\CMS\Menu\NodeThe newly added node

getCss

Get the CSS declarations for this tree

getCss() : array<mixed,string>
deprecated
since

3.8.0

deprecated

4.0

Response

array<mixed,string>

getCurrent

Get the current node

getCurrent() : \Joomla\CMS\Menu\Node
deprecated
since

3.8.0

deprecated

4.0 Use Joomla\CMS\Menu\MenuItem

Response

\Joomla\CMS\Menu\Node

getIconClass

Method to get the CSS class name for an icon identifier or create one if a custom image path is passed as the identifier

getIconClass() : string
deprecated
since

3.8.0

deprecated

4.0

Response

stringCSS class name

getParent

Method to get the parent and set it as active optionally

getParent(boolean $setCurrent = true) : \Joomla\CMS\Menu\Node
deprecated
since

3.8.0

deprecated

4.0 Use Joomla\CMS\Menu\MenuItem

Arguments

$setCurrent

booleanSet that parent as the current node for further working

Response

\Joomla\CMS\Menu\Node

getRoot

Get the root node

getRoot() : \Joomla\CMS\Menu\Node
deprecated
since

3.8.0

deprecated

4.0 Use Joomla\CMS\Menu\MenuItem

Response

\Joomla\CMS\Menu\Node

reset

Method to reset the working pointer to the root node and optionally clear all menu nodes

reset(boolean $clear = false) : \Joomla\CMS\Menu\Node
deprecated
since

3.8.0

deprecated

4.0 Use Joomla\CMS\Menu\MenuItem

Arguments

$clear

booleanWhether to clear the existing menu items or just reset the pointer to root element

Response

\Joomla\CMS\Menu\NodeThe root node

setCurrent

Get the current node

setCurrent(\Joomla\CMS\Menu\Node $node) : void
deprecated
since

3.8.0

deprecated

4.0 Use Joomla\CMS\Menu\MenuItem

Arguments

$node

\Joomla\CMS\Menu\NodeThe node to be set as current

Properties

root

The root menu node

since

3.8.0

Type(s)

\Joomla\CMS\Menu\Node

current

The current working menu node

since

3.8.0

Type(s)

\Joomla\CMS\Menu\Node

css

The CSS style array

since

3.8.0

Type(s)

array<mixed,string>