Model for a simple menu entries with label and icon.
More...
|
| __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 | create ( $name, $text, $url, $className='', $icon=null, $trackable=false) |
| Create a Single Menu entry with text, icon and active click tracking.
|
|
Model for a simple menu entries with label and icon.
◆ __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 | $name | An unique menu element identifier |
string | $text | Text to show on menu element |
string | $url | URL menu element points to |
string | array | $className | Additional CSS class names. |
bool | $isInterface | If 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) |
◆ 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 | $name | Entry identifier |
string | $text | Entry label |
string | $url | The URL entry points to |
string | $className | Optional HTML classes |
string | null | $icon | defaults to $name if not specified |
bool | $trackable | Whether 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
-
- Returns
- $this
◆ overrideText()
MediaWiki\Minerva\Menu\Entries\SingleMenuEntry::overrideText |
( |
string | $text | ) |
|
Override the text used in the home menu entry.
- Parameters
-
- Returns
- $this
◆ setIcon()
MediaWiki\Minerva\Menu\Entries\SingleMenuEntry::setIcon |
( |
| $iconName | ) |
|
Set the Menu entry icon.
- Parameters
-
- Returns
- $this
◆ setNodeID()
MediaWiki\Minerva\Menu\Entries\SingleMenuEntry::setNodeID |
( |
| $nodeID | ) |
|
Set the Menu entry ID html attribute.
- Parameters
-
- Returns
- $this
◆ setTitle()
MediaWiki\Minerva\Menu\Entries\SingleMenuEntry::setTitle |
( |
Message | $message | ) |
|
Set the menu entry title.
- Parameters
-
Message | $message | Title message |
- Returns
- $this
◆ trackClicks()
MediaWiki\Minerva\Menu\Entries\SingleMenuEntry::trackClicks |
( |
| $eventName | ) |
|
- Parameters
-
string | $eventName | Should 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:
- includes/Menu/Entries/SingleMenuEntry.php