Hi! I have and idea about TemplateFactory.
If you need to use your own Template class, you have to extend original TemplateFactory now.
What about this implementation?
protected $templateClass = 'Nette\Bridges\ApplicationLatte\Template';
public function createTemplate(UI\Control $control = NULL)
{
$latte = $this->latteFactory->create();
$template = new $this->templateClass($latte);
$presenter = $control ? $control->getPresenter(FALSE) : NULL;
//...
}
public function setTemplateClass($class)
{
$this->templateClass = $class;
}
What do you think? It makes TemplateFactory more flexible. You can setup your template implementation over NEON config.
services:
latte.templateFactory:
setup:
- setTemplateClass(My\Custom\Template)
Thanks for feedback.
Hi! I have and idea about TemplateFactory.
If you need to use your own Template class, you have to extend original TemplateFactory now.
What about this implementation?
What do you think? It makes TemplateFactory more flexible. You can setup your template implementation over NEON config.
Thanks for feedback.