Skip to content

Commit

Permalink
Link: Introduce Link::openInModal() method
Browse files Browse the repository at this point in the history
  • Loading branch information
yhabteab committed Sep 8, 2023
1 parent 12820bc commit c5b57b5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Widget/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,18 @@ public function createHrefAttribute()
{
return new Attribute('href', (string) $this->getUrl());
}

/**
* Open this link in a modal
*
* @return $this
*/
public function openInModal(): self
{
$this->getAttributes()
->set('data-icinga-modal', true)
->set('data-no-icinga-ajax', true);

return $this;
}
}

0 comments on commit c5b57b5

Please sign in to comment.