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 9, 2020
1 parent 8fc1f0b commit 02610b1
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 02610b1

Please sign in to comment.