Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
orderlink.php
1<?php
2
4
9{
10 private int $orderId;
11 private string $href;
12
17 public function __construct(int $orderId, string $href)
18 {
19 $this->orderId = $orderId;
20 $this->href = $href;
21 }
22
28 private function getLabel(): string
29 {
30 return $this->orderId;
31 }
32
38 public function render(): string
39 {
40 $href = htmlspecialcharsbx($this->href);
41 $label = $this->getLabel();
42
43 if (!$href)
44 {
45 return $label;
46 }
47
48 return "<a href=\"{$href}\">{$label}</a>";
49 }
50}