nette/application

Unable to use custom TemplateFactory with LatteExtension since 3.1

dakujem opened this issue · 0 comments

Version: 3.1.*

Since 3.1, it is impossible to use a custom implementation of Nette\Application\UI\ITemplateFactory (Nette\Application\UI\TemplateFactory since 3.1) with Nette\Bridges\ApplicationDI\LatteExtension.

Steps To Reproduce

  1. implement ITemplateFactory
  2. register it as your template factory service (latte.templateFactory)
  3. try to compile the container

What's going on

LatteExtension registers an on-compile call to LatteExtension::initLattePanel that has a type hint for the concrete implementation Nette\Bridges\ApplicationLatte\TemplateFactory and not the interface, causing TypeError.