2023-01-06 01:45:38 +00:00
|
|
|
<?php
|
|
|
|
namespace MediaWiki\Skins\Vector\Components;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VectorComponentMenuListItem component
|
|
|
|
*/
|
|
|
|
class VectorComponentMenuListItem implements VectorComponent {
|
2023-02-17 22:53:02 +00:00
|
|
|
/** @var VectorComponentLink */
|
2023-01-06 01:45:38 +00:00
|
|
|
private $link;
|
|
|
|
/** @var string */
|
|
|
|
private $class;
|
|
|
|
/** @var string */
|
|
|
|
private $id;
|
|
|
|
|
|
|
|
/**
|
2023-02-17 22:53:02 +00:00
|
|
|
* @param VectorComponentLink $link
|
2023-01-06 01:45:38 +00:00
|
|
|
* @param string $class
|
|
|
|
* @param string $id
|
|
|
|
*/
|
2023-02-17 22:53:02 +00:00
|
|
|
public function __construct( VectorComponentLink $link, string $class = '', string $id = '' ) {
|
2023-01-06 01:45:38 +00:00
|
|
|
$this->link = $link;
|
|
|
|
$this->class = $class;
|
2023-01-26 21:33:03 +00:00
|
|
|
$this->id = $id;
|
2023-01-06 01:45:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritDoc
|
|
|
|
*/
|
|
|
|
public function getTemplateData(): array {
|
|
|
|
return $this->link->getTemplateData() + [
|
|
|
|
'item-class' => $this->class,
|
|
|
|
'item-id' => $this->id,
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|