Tree

Menu Tree class to represent a menu tree hierarchy

deprecated
since

3.8.0

deprecated

4.0 Use Joomla\CMS\Menu\MenuItem

package

Joomla CMS

Methods

__construct

Constructor

__construct() : mixed
deprecated
since

3.8.0

deprecated

4.0 Use Joomla\CMS\Menu\MenuItem

Response

mixed

addChild

Method to add a child

addChild(\Joomla\CMS\Menu\Node node, bool 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

boolSet 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() : string[]
deprecated
since

3.8.0

deprecated

4.0

Response

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(bool setCurrent = true) : \Joomla\CMS\Menu\Node
deprecated
since

3.8.0

deprecated

4.0 Use Joomla\CMS\Menu\MenuItem

Arguments

setCurrent

boolSet 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(bool clear = false) : \Joomla\CMS\Menu\Node
deprecated
since

3.8.0

deprecated

4.0 Use Joomla\CMS\Menu\MenuItem

Arguments

clear

boolWhether 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)

string[]