Skip to content

Commit f04323c

Browse files
authored
Redesigned render function to use new template
1 parent b8a308c commit f04323c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Infinityloop/LazyComponent/LazyComponent.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ public function renderLoadComponentLink() : void
2121

2222
public function render() : void
2323
{
24-
if (!$this->loaded) {
25-
$this->template->setFile(__DIR__ . '/emptyComponent.latte');
26-
} else {
24+
$this->template->setFile(__DIR__ . '/LazyComponent.latte');
25+
$this->template->loaded = $this->loaded;
26+
27+
if ($this->loaded) {
2728
$this->beforeRender();
28-
$this->template->setFile(\str_replace('.php', '.latte', static::getReflection()->getFileName()));
29+
$this->template->lazyTemplate = \str_replace('.php', '.latte', static::getReflection()->getFileName());
2930
}
3031

3132
$this->template->render();

0 commit comments

Comments
 (0)