MenuHelper
Menu Helper utility
since |
3.8.0 |
---|
Methods
__construct
Private constructor
__construct()
since |
3.8.0 |
---|
addPreset
Add a custom preset externally via plugin or any other means.
addPreset(string $name, string $title, string $path, boolean $replace = true) : void
WARNING: Presets with same name will replace previously added preset except Joomla's default preset (joomla)
since |
3.8.0 |
---|
Arguments
- $name
string
The unique identifier for the preset.- $title
string
The display label for the preset.- $path
string
The path to the preset file.- $replace
boolean
Whether 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(array<mixed,\stdClass> $menuItems) : array<mixed,\stdClass>
since |
3.8.0 |
---|
Arguments
- $menuItems
array<mixed,\stdClass>
List of menu items loaded from database
Response
array<mixed,\stdClass>
getPresets
Get a list of available presets.
getPresets() : array<mixed,\stdClass>
since |
3.8.0 |
---|
Response
array<mixed,\stdClass>
loadPreset
Load the menu items from a preset file into a hierarchical list of objects
loadPreset(string $name, boolean $fallback = true) : array<mixed,\stdClass>
since |
3.8.0 |
---|
Arguments
- $name
string
The preset name- $fallback
boolean
Fallback to default (joomla) preset if the specified one could not be loaded?
Response
array<mixed,\stdClass>
loadXml
Load a menu tree from an XML file
loadXml(array<mixed,\SimpleXMLElement> $elements, &$items, array<mixed,string> $replace = array()) : void
since |
3.8.0 |
---|
Arguments
- $elements
array<mixed,\SimpleXMLElement>
The xml menuitem nodes- $items
- $replace
array<mixed,string>
The substring replacements for iterator type items
parseXmlNode
Create a menu item node from an xml element
parseXmlNode(\SimpleXMLElement $node, array<mixed,string> $replace = array()) : \stdClass
since |
3.8.0 |
---|
Arguments
- $node
\SimpleXMLElement
A menuitem element from preset xml- $replace
array<mixed,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( &$item) : void
since |
3.8.0 |
---|
Arguments
- $item
Properties
presets
List of preset include paths
since |
3.8.0 |
---|
Type(s)
array