| 1 |
<?php |
| 2 |
namespace MediaWiki\Skins\Vector\Components; |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
class VectorComponentMenuListItem implements VectorComponent { |
| 8 |
|
| 9 |
private $link; |
| 10 |
|
| 11 |
private $class; |
| 12 |
|
| 13 |
private $id; |
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
public function __construct( VectorComponentLink $link, string $class = '', string $id = '' ) { |
| 21 |
$this->link = $link; |
| 22 |
$this->class = $class; |
| 23 |
$this->id = $id; |
| 24 |
} |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
public function getTemplateData(): array { |
| 30 |
return $this->link->getTemplateData() + [ |
| 31 |
'item-class' => $this->class, |
| 32 |
'item-id' => $this->id, |
| 33 |
]; |
| 34 |
} |
| 35 |
} |