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 Jan 3, 2020
1 parent 285b421 commit 47e6692
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Application/UI/Link.php
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->parameters);
}


/**
* Converts link to URL.
*/
Expand Down

0 comments on commit 47e6692

Please sign in to comment.