MenuHelper
Menu Helper utility
| since |
3.8.0 |
|---|---|
| deprecated |
4.0 |
| package |
Joomla CMS |
Methods
__construct
Private constructor
__construct() : mixed
| since |
3.8.0 |
|---|---|
| deprecated |
4.0 |
Response
mixed
addPreset
Add a custom preset externally via plugin or any other means.
addPreset(string name, string title, string path, bool replace = true) : void
WARNING: Presets with same name will replace previously added preset except Joomla's default preset (joomla)
| since |
3.8.0 |
|---|---|
| deprecated |
4.0 Use Joomla\Component\Menus\Administrator\Helper\MenusHelper |
Arguments
- name
stringThe unique identifier for the preset.- title
stringThe display label for the preset.- path
stringThe path to the preset file.- replace
boolWhether to replace the preset with the same name if any (except 'joomla').
createLevels
Parse the flat list of menu items and prepare the hierarchy of them using parent-child relationship.
createLevels(\stdClass[] menuItems) : \stdClass[]
| since |
3.8.0 |
|---|---|
| deprecated |
4.0 |
Arguments
- menuItems
\stdClass[]List of menu items loaded from database
Response
\stdClass[]
getPresets
Get a list of available presets.
getPresets() : \stdClass[]
| since |
3.8.0 |
|---|---|
| deprecated |
4.0 Use Joomla\Component\Menus\Administrator\Helper\MenusHelper |
Response
\stdClass[]
loadPreset
Load the menu items from a preset file into a hierarchical list of objects
loadPreset(string name, bool fallback = true) : \stdClass[]
| since |
3.8.0 |
|---|---|
| deprecated |
4.0 Use Joomla\Component\Menus\Administrator\Helper\MenusHelper |
Arguments
- name
stringThe preset name- fallback
boolFallback to default (joomla) preset if the specified one could not be loaded?
Response
\stdClass[]
loadXml
Load a menu tree from an XML file
loadXml(\SimpleXMLElement[] elements, \stdClass[] &items, string[] replace = array()) : void
| since |
3.8.0 |
|---|---|
| deprecated |
4.0 Use Joomla\Component\Menus\Administrator\Helper\MenusHelper |
Arguments
- elements
\SimpleXMLElement[]The xml menuitem nodes- items
\stdClass[]The menu hierarchy list to be populated- replace
string[]The substring replacements for iterator type items
parseXmlNode
Create a menu item node from an xml element
parseXmlNode(\SimpleXMLElement node, string[] replace = array()) : \stdClass
| since |
3.8.0 |
|---|---|
| deprecated |
4.0 Use Joomla\Component\Menus\Administrator\Helper\MenusHelper |
Arguments
- node
\SimpleXMLElementA menuitem element from preset xml- replace
string[]The values to substitute in the title, link and element texts
Response
\stdClass
resolveAlias
Method to resolve the menu item alias type menu item
resolveAlias(\stdClass &item) : void
| since |
3.8.0 |
|---|---|
| deprecated |
4.0 Use Joomla\Component\Menus\Administrator\Helper\MenusHelper |
Arguments
- item
\stdClassThe alias object
Properties
presets
List of preset include paths
| since |
3.8.0 |
|---|
Type(s)
array