mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-14 19:26:42 +00:00
0e5ef398b2
Now that there is a Link.mustache, I think other components like Button, Link should use the Icon template, and not include icon in the name, as its possible to have a link or button that doesnt use an icon as well. Change-Id: I6d8a17dd956f09bb3df7a2503f55d255599874f8
36 lines
731 B
PHP
36 lines
731 B
PHP
<?php
|
|
namespace MediaWiki\Skins\Vector\Components;
|
|
|
|
/**
|
|
* VectorComponentMenuListItem component
|
|
*/
|
|
class VectorComponentMenuListItem implements VectorComponent {
|
|
/** @var VectorComponentLink */
|
|
private $link;
|
|
/** @var string */
|
|
private $class;
|
|
/** @var string */
|
|
private $id;
|
|
|
|
/**
|
|
* @param VectorComponentLink $link
|
|
* @param string $class
|
|
* @param string $id
|
|
*/
|
|
public function __construct( VectorComponentLink $link, string $class = '', string $id = '' ) {
|
|
$this->link = $link;
|
|
$this->class = $class;
|
|
$this->id = $id;
|
|
}
|
|
|
|
/**
|
|
* @inheritDoc
|
|
*/
|
|
public function getTemplateData(): array {
|
|
return $this->link->getTemplateData() + [
|
|
'item-class' => $this->class,
|
|
'item-id' => $this->id,
|
|
];
|
|
}
|
|
}
|