Nette 2.1 > 2.2 nette.latte macro install in config.neon

5 years ago

mcmatak
Member | 499
+
0
-

i am used to install macros in config.neon

nette.latte:
    class: \Nette\Latte\Engine
    autowired: no
    setup:
        - \System\Templates\LatteMacros::install(::$service->getCompiler())
        - \System\Application\Templates\ImageManager\ImageManagerMacro::install(::$service->getCompiler())

is there a similar way in Nette 2.2 ?

5 years ago

David Grudl
Nette Core | 6871
+
+1
-

Dej to do služby nette.latteFactory.

Ten zápis ::$service->getCompiler() by správně neměl fungoval, korektní je @self::getCompiler.

5 years ago

mcmatak
Member | 499
+
0
-

Service ‘nette.templateFactory’: Service of type Nette\Bridges\ApplicationLatte\ILatteFactory needed by Nette\Bridges\ApplicationLatte\TemplateFactory::__construct() not found. Did you register it in configuration file?

:(

5 years ago

David Grudl
Nette Core | 6871
+
0
-

Myslím dát tam jen ten setup

5 years ago

David Grudl
Nette Core | 6871
+
0
-

Proč to neděláš standardní cestou? https://doc.nette.org/…/configuring#…

5 years ago

mcmatak
Member | 499
+
0
-

díky udělal jsem to standardně a po pár změnách to jede, byla to nějaká historická věc

5 years ago

Majkl578
Moderator | 1379
+
0
-

This is english forum, not czech.