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

Model for a simple menu entries with label and icon. More...

+ Inheritance diagram for MediaWiki\Minerva\Menu\Entries\SingleMenuEntry:
+ Collaboration diagram for MediaWiki\Minerva\Menu\Entries\SingleMenuEntry:

Public Member Functions

 __construct (string $name, string $text, string $url, $className='', bool $isInterface=true)
 Create a simple menu element with one component.
 
 overrideIcon (string $icon)
 Override the icon used in the home menu entry.
 
 overrideText (string $text)
 Override the text used in the home menu entry.
 
 getName ()
 @inheritDoc
 
 getCSSClasses ()
 @inheritDoc
 
 getComponents ()
 @inheritDoc
 
 trackClicks ( $eventName)
 
 setIcon ( $iconName)
 Set the Menu entry icon.
 
 setTitle (Message $message)
 Set the menu entry title.
 
 setNodeID ( $nodeID)
 Set the Menu entry ID html attribute.
 
 setJSOnly ()
 Mark entry as JS only.
 

Static Public Member Functions

static create ( $name, $text, $url, $className='', $icon=null, $trackable=false)
 Create a Single Menu entry with text, icon and active click tracking.
 

Detailed Description

Model for a simple menu entries with label and icon.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Minerva\Menu\Entries\SingleMenuEntry::__construct ( string $name,
string $text,
string $url,
$className = '',
bool $isInterface = true )

Create a simple menu element with one component.

Parameters
string$nameAn unique menu element identifier
string$textText to show on menu element
string$urlURL menu element points to
string | array$classNameAdditional CSS class names.
bool$isInterfaceIf true, the menu element is provided with data-mw='interface' and is treated as a standard part of the interface (ie. MediaWiki Core might bind to the menu element)

Member Function Documentation

◆ create()

static MediaWiki\Minerva\Menu\Entries\SingleMenuEntry::create ( $name,
$text,
$url,
$className = '',
$icon = null,
$trackable = false )
static

Create a Single Menu entry with text, icon and active click tracking.

Parameters
string$nameEntry identifier
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.
Returns
static

◆ getComponents()

MediaWiki\Minerva\Menu\Entries\SingleMenuEntry::getComponents ( )

◆ getCSSClasses()

MediaWiki\Minerva\Menu\Entries\SingleMenuEntry::getCSSClasses ( )

◆ getName()

MediaWiki\Minerva\Menu\Entries\SingleMenuEntry::getName ( )

◆ overrideIcon()

MediaWiki\Minerva\Menu\Entries\SingleMenuEntry::overrideIcon ( string $icon)

Override the icon used in the home menu entry.

Parameters
string$icon
Returns
$this

◆ overrideText()

MediaWiki\Minerva\Menu\Entries\SingleMenuEntry::overrideText ( string $text)

Override the text used in the home menu entry.

Parameters
string$text
Returns
$this

◆ setIcon()

MediaWiki\Minerva\Menu\Entries\SingleMenuEntry::setIcon ( $iconName)

Set the Menu entry icon.

Parameters
string | null$iconName
Returns
$this

◆ setNodeID()

MediaWiki\Minerva\Menu\Entries\SingleMenuEntry::setNodeID ( $nodeID)

Set the Menu entry ID html attribute.

Parameters
string$nodeID
Returns
$this

◆ setTitle()

MediaWiki\Minerva\Menu\Entries\SingleMenuEntry::setTitle ( Message $message)

Set the menu entry title.

Parameters
Message$messageTitle message
Returns
$this

◆ trackClicks()

MediaWiki\Minerva\Menu\Entries\SingleMenuEntry::trackClicks ( $eventName)
Parameters
string$eventNameShould clicks be tracked. To override the tracking code pass the tracking code as string
Returns
$this

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