Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'ui/include/classes/html/CLabel.php')
-rw-r--r--ui/include/classes/html/CLabel.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/ui/include/classes/html/CLabel.php b/ui/include/classes/html/CLabel.php
index 513dfe94eb0..ab41f1493fc 100644
--- a/ui/include/classes/html/CLabel.php
+++ b/ui/include/classes/html/CLabel.php
@@ -21,12 +21,18 @@
class CLabel extends CTag {
- public function __construct($label, $for = null) {
+ public function __construct($label, $id = null) {
parent::__construct('label', true, $label);
- if ($for !== null) {
- $this->setAttribute('for', zbx_formatDomId($for));
+ $this->setFor($id);
+ }
+
+ public function setFor($id): self {
+ if ($id !== null) {
+ $this->setAttribute('for', zbx_formatDomId($id));
}
+
+ return $this;
}
/**