Skip to content

Commit 94ec03c

Browse files
committed
TemplateFactory: dependency on nette/caching is optional
1 parent 5a4b2cf commit 94ec03c

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
@@ -67,7 +67,9 @@ public function createTemplate(UI\Control $control = NULL)
6767
}
6868

6969
array_unshift($latte->onCompile, function ($latte) use ($control, $template) {
70-
$latte->getCompiler()->addMacro('cache', new Nette\Bridges\CacheLatte\CacheMacro($latte->getCompiler()));
70+
if ($this->cacheStorage) {
71+
$latte->getCompiler()->addMacro('cache', new Nette\Bridges\CacheLatte\CacheMacro($latte->getCompiler()));
72+
}
7173
UIMacros::install($latte->getCompiler());
7274
if (class_exists(Nette\Bridges\FormsLatte\FormMacros::class)) {
7375
Nette\Bridges\FormsLatte\FormMacros::install($latte->getCompiler());

0 commit comments

Comments
 (0)