Skip to content

Commit

Permalink
Link: added isLinkCurrent() & getComponent() [Closes #229]
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Nov 2, 2020
1 parent bb65d4c commit 71cd995
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Application/UI/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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.
*/
Expand Down

0 comments on commit 71cd995

Please sign in to comment.