diff --git a/src/Widget/Link.php b/src/Widget/Link.php index 2d7c9f57..cbae3b95 100644 --- a/src/Widget/Link.php +++ b/src/Widget/Link.php @@ -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; + } }