We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b8a308c commit f04323cCopy full SHA for f04323c
src/Infinityloop/LazyComponent/LazyComponent.php
@@ -21,11 +21,12 @@ public function renderLoadComponentLink() : void
21
22
public function render() : void
23
{
24
- if (!$this->loaded) {
25
- $this->template->setFile(__DIR__ . '/emptyComponent.latte');
26
- } else {
+ $this->template->setFile(__DIR__ . '/LazyComponent.latte');
+ $this->template->loaded = $this->loaded;
+
27
+ if ($this->loaded) {
28
$this->beforeRender();
- $this->template->setFile(\str_replace('.php', '.latte', static::getReflection()->getFileName()));
29
+ $this->template->lazyTemplate = \str_replace('.php', '.latte', static::getReflection()->getFileName());
30
}
31
32
$this->template->render();
0 commit comments