From cf999ff3212afdadd107a631eebf0d6296801498 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Fri, 3 Jan 2020 22:52:43 +0100 Subject: [PATCH] Link: added isLinkCurrent() & getComponent() [Closes #229] --- src/Application/UI/Link.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/Application/UI/Link.php b/src/Application/UI/Link.php index 751dc999f..b06937bb5 100644 --- a/src/Application/UI/Link.php +++ b/src/Application/UI/Link.php @@ -41,6 +41,15 @@ public function __construct(Component $component, string $destination, array $pa } + /** + * Returns link component. + */ + public function getComponent(): Component + { + return $this->component; + } + + /** * Returns link destination. */ @@ -80,6 +89,15 @@ public function getParameters(): array } + /** + * Determines whether this links to the current page. + */ + public function isLinkCurrent(): bool + { + return $this->component->isLinkCurrent($this->destination, $this->parameters); + } + + /** * Converts link to URL. */