MinervaNeue
A responsive mobile first skin
Loading...
Searching...
No Matches
MediaWiki\Minerva\Menu\Group Class Reference

Model for a menu that can be presented in a skin. More...

Public Member Functions

 __construct ( $id)
 
 getId ()
 Get the identifier for the group.
 
 hasEntries ()
 Return entries count.
 
 getEntries ()
 Get all entries represented as plain old PHP arrays.
 
 insertEntry (IMenuEntry $entry)
 Insert new menu entry.
 
 insertAfter ( $targetName, $name, $text, $url, $className='', $icon=null, $trackable=false, $isJSOnly=false)
 Insert an entry after an existing one.
 
 getEntryByName ( $targetName)
 
 serialize ()
 Serialize the group for use in a template.
 

Detailed Description

Model for a menu that can be presented in a skin.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Minerva\Menu\Group::__construct ( $id)
Parameters
string$idof the menu defaults to null (optional)

Member Function Documentation

◆ getEntries()

MediaWiki\Minerva\Menu\Group::getEntries ( )

Get all entries represented as plain old PHP arrays.

Returns
array

◆ getEntryByName()

MediaWiki\Minerva\Menu\Group::getEntryByName ( $targetName)
Parameters
string$targetName
Returns
IMenuEntry
Exceptions
DomainException

◆ getId()

MediaWiki\Minerva\Menu\Group::getId ( )

Get the identifier for the group.

Returns
string

◆ hasEntries()

MediaWiki\Minerva\Menu\Group::hasEntries ( )

Return entries count.

Returns
bool

◆ insertAfter()

MediaWiki\Minerva\Menu\Group::insertAfter ( $targetName,
$name,
$text,
$url,
$className = '',
$icon = null,
$trackable = false,
$isJSOnly = false )

Insert an entry after an existing one.

Deprecated
since 1.39
Parameters
string$targetNameThe name of the existing entry to insert the new entry after
string$nameThe name of the new entry
string$textEntry label
string$urlThe URL entry points to
string$classNameOptional HTML classes
string | null$icondefaults to $name if not specified
bool$trackableWhether an entry will track clicks or not. Default is false.
bool$isJSOnlyWhether the entry works without JS
Exceptions
DomainExceptionWhen the existing entry doesn't exist

◆ insertEntry()

MediaWiki\Minerva\Menu\Group::insertEntry ( IMenuEntry $entry)

Insert new menu entry.

Parameters
IMenuEntry$entry
Exceptions
DomainExceptionWhen the entry already exists

◆ serialize()

MediaWiki\Minerva\Menu\Group::serialize ( )

Serialize the group for use in a template.

Returns
array{entries:array,id:string}

The documentation for this class was generated from the following file: