@@ -48,20 +48,21 @@ public function loadConfiguration()
4848 $ config = $ this ->validateConfig ($ this ->defaults );
4949 $ builder = $ this ->getContainerBuilder ();
5050
51- $ latteFactory = $ builder ->addDefinition ($ this ->prefix ('latteFactory ' ))
52- ->setFactory (Latte \Engine::class)
53- ->addSetup ('setTempDirectory ' , [$ this ->tempDir ])
54- ->addSetup ('setAutoRefresh ' , [$ this ->debugMode ])
55- ->addSetup ('setContentType ' , [$ config ['xhtml ' ] ? Latte \Compiler::CONTENT_XHTML : Latte \Compiler::CONTENT_HTML ])
56- ->addSetup ('Nette\Utils\Html::$xhtml = ? ' , [(bool ) $ config ['xhtml ' ]])
57- ->setImplement (Nette \Bridges \ApplicationLatte \ILatteFactory::class);
51+ $ latteFactory = $ builder ->addFactoryDefinition ($ this ->prefix ('latteFactory ' ))
52+ ->setImplement (Nette \Bridges \ApplicationLatte \ILatteFactory::class)
53+ ->getResultDefinition ()
54+ ->setFactory (Latte \Engine::class)
55+ ->addSetup ('setTempDirectory ' , [$ this ->tempDir ])
56+ ->addSetup ('setAutoRefresh ' , [$ this ->debugMode ])
57+ ->addSetup ('setContentType ' , [$ config ['xhtml ' ] ? Latte \Compiler::CONTENT_XHTML : Latte \Compiler::CONTENT_HTML ])
58+ ->addSetup ('Nette\Utils\Html::$xhtml = ? ' , [(bool ) $ config ['xhtml ' ]]);
5859
5960 if ($ config ['strictTypes ' ]) {
6061 $ latteFactory ->addSetup ('setStrictTypes ' , [true ]);
6162 }
6263
6364 $ builder ->addDefinition ($ this ->prefix ('templateFactory ' ))
64- ->setClass (Nette \Application \UI \ITemplateFactory::class)
65+ ->setType (Nette \Application \UI \ITemplateFactory::class)
6566 ->setFactory (Nette \Bridges \ApplicationLatte \TemplateFactory::class)
6667 ->setArguments (['templateClass ' => $ config ['templateClass ' ]]);
6768
@@ -79,7 +80,7 @@ public function loadConfiguration()
7980 public function addMacro (string $ macro ): void
8081 {
8182 $ builder = $ this ->getContainerBuilder ();
82- $ definition = $ builder ->getDefinition ($ this ->prefix ('latteFactory ' ));
83+ $ definition = $ builder ->getDefinition ($ this ->prefix ('latteFactory ' ))-> getResultDefinition () ;
8384
8485 if (($ macro [0 ] ?? null ) === '@ ' ) {
8586 if (strpos ($ macro , ':: ' ) === false ) {
0 commit comments