MenuItem
Implements NodeInterfaceObject representing a menu item
since |
3.7.0 |
---|---|
package |
Joomla CMS |
Methods
__construct
Class constructor
__construct(mixed||string|int data = []) :
since |
3.7.0 |
---|
Arguments
- data
array<string|int, mixed>
The menu item data to load
Response
mixed
addChild
Add child to this node
addChild(\Joomla\CMS\Tree\NodeInterface child) :
If the child already has a parent, the link is unset
since |
4.0.0 |
---|
Arguments
- child
NodeInterface
The child to be added.
Response
void
getParams
Returns the menu item parameters
getParams() : \Joomla\Registry\Registry
since |
3.7.0 |
---|
Response
Registry
removeChild
Remove a specific child
removeChild(\Joomla\CMS\Tree\NodeInterface child) :
setParams
Sets the menu item parameters
setParams(\Joomla\Registry\Registry|string params) :
since |
3.7.0 |
---|
Arguments
- params
Registry|string
The data to be stored as the parameters
Response
void
setParent
Set the parent of this node
setParent(\Joomla\CMS\Tree\NodeInterface parent) :
If the node already has a parent, the link is unset
since |
4.0.0 |
---|
Arguments
- parent
NodeInterface
NodeInterface for the parent to be set
Response
void
setSibling
Function to set the left or right sibling of a node
setSibling(\Joomla\CMS\Tree\NodeInterface sibling, right = true) :
since |
4.0.0 |
---|
Arguments
- sibling
NodeInterface
NodeInterface object for the sibling- right
bool
If set to false, the sibling is the left one
Response
void
Properties
id
Primary key
since |
3.7.0 |
---|
Type(s)
int
title
The display title of the menu item
since |
3.7.0 |
---|
Type(s)
string
alias
The SEF alias of the menu item
since |
3.7.0 |
---|
Type(s)
string
note
A note associated with the menu item
since |
3.7.0 |
---|
Type(s)
string
route
The computed path of the menu item based on the alias field, this is populated from the path
field in the #__menu
table
since |
3.7.0 |
---|
Type(s)
string
link
The actual link the menu item refers to
since |
3.7.0 |
---|
Type(s)
string
type
The type of link
since |
3.7.0 |
---|
Type(s)
string
level
The relative level in the tree
since |
3.7.0 |
---|
Type(s)
int
language
The assigned language for this item
since |
3.7.0 |
---|
Type(s)
string
access
The access level required to view the menu item
since |
3.7.0 |
---|
Type(s)
int
params
The menu item parameters
since |
3.7.0 |
---|---|
note |
This field is protected to require reading this field to proxy through the getter to convert the params to a Registry instance |
Type(s)
string|Registry
home
Indicates if this menu item is the home or default page
since |
3.7.0 |
---|
Type(s)
int
img
The image of the menu item
since |
3.7.0 |
---|
Type(s)
string
template_style_id
The optional template style applied to this menu item
since |
3.7.0 |
---|
Type(s)
int
component_id
The extension ID of the component this menu item is for
since |
3.7.0 |
---|
Type(s)
int
parent_id
The parent menu item in the menu tree
since |
3.7.0 |
---|
Type(s)
int
component
The name of the component this menu item is for
since |
3.7.0 |
---|
Type(s)
string
tree
The tree of parent menu items
since |
3.7.0 |
---|
Type(s)
array<string|int, mixed>
query
An array of the query string values for this item
since |
3.7.0 |
---|
Type(s)
array<string|int, mixed>