From 466bcb9429564a76e75248048e273b1b319d5d23 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..7236be96f 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->params); + } + + /** * Converts link to URL. */