Skip to content

Commit 3e14b3d

Browse files
committed
TemplateFactory: dependency on nette/caching is optional
1 parent 147e265 commit 3e14b3d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Bridges/ApplicationLatte/TemplateFactory.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ public function createTemplate(UI\Control $control = NULL)
6969
}
7070

7171
array_unshift($latte->onCompile, function ($latte) use ($control, $template) {
72-
$latte->getCompiler()->addMacro('cache', new Nette\Bridges\CacheLatte\CacheMacro($latte->getCompiler()));
72+
if ($this->cacheStorage) {
73+
$latte->getCompiler()->addMacro('cache', new Nette\Bridges\CacheLatte\CacheMacro($latte->getCompiler()));
74+
}
7375
UIMacros::install($latte->getCompiler());
7476
if (class_exists(Nette\Bridges\FormsLatte\FormMacros::class)) {
7577
Nette\Bridges\FormsLatte\FormMacros::install($latte->getCompiler());

0 commit comments

Comments
 (0)