Commit | Line | Data |
---|---|---|
11ade432 AE |
1 | <?php |
2 | namespace wcf\system\breadcrumb; | |
11ade432 AE |
3 | |
4 | /** | |
5 | * Represents a breadcrumb. | |
6 | * | |
7 | * @author Alexander Ebert | |
c839bd49 | 8 | * @copyright 2001-2018 WoltLab GmbH |
11ade432 | 9 | * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> |
e71525e4 | 10 | * @package WoltLabSuite\Core\System\Breadcrumb |
11ade432 AE |
11 | */ |
12 | class Breadcrumb { | |
13 | /** | |
14 | * displayed label | |
11ade432 AE |
15 | * @var string |
16 | */ | |
17 | protected $label = ''; | |
18 | ||
19 | /** | |
20 | * target url | |
11ade432 AE |
21 | * @var string |
22 | */ | |
23 | protected $url = ''; | |
24 | ||
7f5fc6ed MW |
25 | /** |
26 | * Creates a new Breadcrumb object. | |
27 | * | |
28 | * @param string $label | |
29 | * @param string $url | |
30 | */ | |
a38d6544 AE |
31 | public function __construct($label, $url) { |
32 | $this->setLabel($label); | |
33 | $this->setURL($url); | |
7f5fc6ed MW |
34 | } |
35 | ||
11ade432 AE |
36 | /** |
37 | * Sets the displayed label. | |
38 | * | |
39 | * @param string $label | |
9f959ced | 40 | */ |
11ade432 AE |
41 | public function setLabel($label) { |
42 | $this->label = $label; | |
43 | } | |
44 | ||
45 | /** | |
772f616f | 46 | * Sets the target url. |
11ade432 AE |
47 | * May be left empty to disable url functionality. |
48 | * | |
49 | * @param string $url | |
e71525e4 | 50 | * @param boolean $appendSession This parameter is unused as of version 3.0 |
9f959ced | 51 | */ |
9f4133d4 | 52 | public function setURL($url, $appendSession = false) { |
11ade432 AE |
53 | $this->url = $url; |
54 | } | |
55 | ||
56 | /** | |
57 | * Returns displayed label. | |
58 | * | |
59 | * @return string | |
60 | */ | |
61 | public function getLabel() { | |
62 | return $this->label; | |
63 | } | |
64 | ||
65 | /** | |
66 | * Returns target url. | |
67 | * | |
68 | * @return string | |
69 | */ | |
70 | public function getURL() { | |
71 | return $this->url; | |
72 | } | |
73 | } |