File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/Bridges/ApplicationDI Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ class LatteExtension extends Nette\DI\CompilerExtension
2222 'xhtml ' => FALSE ,
2323 'macros ' => [],
2424 'templateClass ' => NULL ,
25+ 'strictTypes ' => FALSE ,
2526 ];
2627
2728 /** @var bool */
@@ -47,14 +48,18 @@ public function loadConfiguration()
4748 $ config = $ this ->validateConfig ($ this ->defaults );
4849 $ builder = $ this ->getContainerBuilder ();
4950
50- $ builder ->addDefinition ($ this ->prefix ('latteFactory ' ))
51+ $ latteFactory = $ builder ->addDefinition ($ this ->prefix ('latteFactory ' ))
5152 ->setClass (Latte \Engine::class)
5253 ->addSetup ('setTempDirectory ' , [$ this ->tempDir ])
5354 ->addSetup ('setAutoRefresh ' , [$ this ->debugMode ])
5455 ->addSetup ('setContentType ' , [$ config ['xhtml ' ] ? Latte \Compiler::CONTENT_XHTML : Latte \Compiler::CONTENT_HTML ])
5556 ->addSetup ('Nette\Utils\Html::$xhtml = ? ' , [(bool ) $ config ['xhtml ' ]])
5657 ->setImplement (Nette \Bridges \ApplicationLatte \ILatteFactory::class);
5758
59+ if ($ config ['strictTypes ' ]) {
60+ $ latteFactory ->addSetup ('setStrictTypes ' , [TRUE ]);
61+ }
62+
5863 $ builder ->addDefinition ($ this ->prefix ('templateFactory ' ))
5964 ->setClass (Nette \Application \UI \ITemplateFactory::class)
6065 ->setFactory (Nette \Bridges \ApplicationLatte \TemplateFactory::class)
You can’t perform that action at this time.
0 commit comments