Skip to content

Commit 40b5b03

Browse files
committed
Link: added isLinkCurrent() & getComponent() [Closes #229]
1 parent 558bcba commit 40b5b03

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/Application/UI/Link.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ public function __construct(Component $component, string $destination, array $pa
4141
}
4242

4343

44+
/**
45+
* Returns link component.
46+
*/
47+
public function getComponent(): Component
48+
{
49+
return $this->component;
50+
}
51+
52+
4453
/**
4554
* Returns link destination.
4655
*/
@@ -80,6 +89,15 @@ public function getParameters(): array
8089
}
8190

8291

92+
/**
93+
* Determines whether this links to the current page.
94+
*/
95+
public function isLinkCurrent(): bool
96+
{
97+
return $this->component->isLinkCurrent($this->destination, $this->params);
98+
}
99+
100+
83101
/**
84102
* Converts link to URL.
85103
*/

0 commit comments

Comments
 (0)