mediawiki-skins-Vector/includes/Components/VectorComponentMenuListItem.php
bwang 0e5ef398b2 Rename IconLink to Link
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
2023-02-22 22:00:24 +00:00

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,
];
}
}