diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-01-16 15:00:42 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-01-16 15:00:42 +0000 |
| commit | 90c75e7f10f9a5ebb777649f1ef2b149ee7333b1 (patch) | |
| tree | 0bdb810c9930d18b98a605a8fe2c5aa2a22b6941 /lib/classes/VueApp.php | |
| parent | d397e14a9add596d7284fdc6ec46325c8815848f (diff) | |
post notifications VueAppWillRender and VueAppDidRender in StudipController::renderVueApp() as well and provide method that directly sets slots on a VueApp instance, fixes #5148
Closes #5148
Merge request studip/studip!3848
Diffstat (limited to 'lib/classes/VueApp.php')
| -rw-r--r-- | lib/classes/VueApp.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/classes/VueApp.php b/lib/classes/VueApp.php index c26b011..910f503 100644 --- a/lib/classes/VueApp.php +++ b/lib/classes/VueApp.php @@ -83,6 +83,15 @@ final class VueApp implements Stringable } /** + * Set the content of a slot. + */ + public function setSlot(string $name, string|Template $content): VueApp + { + $this->slots[$name] = $content instanceof Template ? $content->render() : $content; + return $this; + } + + /** * Add a slot with the given name * * If you pass a flexi template as the content, it will be rendered. |
