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 ( $name, $text, $url, $className='')
 Create a simple menu element with one component.
 
 overrideIcon ( $icon)
 Override the icon used in the home menu entry.
 
 overrideText ( $text)
 Override the text used in the home menu entry.
 
 getName ()
 @inheritDoc
 
 getCSSClasses ()
 @inheritDoc
 
 getComponents ()
 @inheritDoc
 
 trackClicks ( $eventName)
 
 setIcon ( $iconName, $iconType='before', $additionalClassNames='', $iconPrefix='minerva')
 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 ( $name,
$text,
$url,
$className = '' )

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.

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 ( $icon)

Override the icon used in the home menu entry.

Parameters
string$icon
Returns
$this

◆ overrideText()

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

Override the text used in the home menu entry.

Parameters
string$text
Returns
$this

◆ setIcon()

MediaWiki\Minerva\Menu\Entries\SingleMenuEntry::setIcon ( $iconName,
$iconType = 'before',
$additionalClassNames = '',
$iconPrefix = 'minerva' )

Set the Menu entry icon.

Parameters
string | null$iconName
string$iconType
string$additionalClassNamesAdditional classes
string$iconPrefixeither wikimedia or minerva
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: