ILIAS  release_7 Revision v7.30-3-g800a261c036
LabeledMenu.php
Go to the documentation of this file.
1<?php
2declare(strict_types=1);
3
4/* Copyright (c) 2019 Nils Haagen <nils.haagen@concepts-and-training.de> Extended GPL, see docs/LICENSE */
5
7
8use ILIAS\UI\Component as Component;
11
15abstract class LabeledMenu extends Menu implements IMenu\LabeledMenu
16{
20 protected $label;
21
25 public function getLabel()
26 {
27 return $this->label;
28 }
29
33 public function withLabel($label) : IMenu\LabeledMenu
34 {
36 $clone = clone $this;
37 $clone->label = $label;
38 return $clone;
39 }
40
44 protected function checkLabelParameter($label)
45 {
46 $classes = [Component\Clickable::class, "string"];
47 $check = [$label];
48 $this->checkArgListElements("label", $check, $classes);
49 }
50}
An exception for terminatinating execution or to throw for unit testing.
getLabel()
Get the label for this menu.Component\Clickable | string
Definition: LabeledMenu.php:25
This describes a Menu Control with a label.
Definition: LabeledMenu.php:14
checkArgListElements($which, array &$values, $classes)
Check every element of the list if it is an instance of one of the given classes.
trait ComponentHelper
Provides common functionality for component implementations.