How to create / insert latte template from string

vnovotny
Member | 12
+
0
-

Hi guys,

I need some help. I did some project in Nette 2.1.1 and back then I had some string containing latte helpers stored in variable. I wanted to put interpreted content of variable into control template, so I did this:

$this->template->variable = $this->createTemplate('Nette\Templating\Template')->setSource($stringWith-Helpers);

In Nette 2.2.2 is Nette\Templating\Template Depricated and setSource method missing. How can I put string containing helpers into template now? I tried to find solution in Latte documentation, but it seems to be outdated.

Milo
Nette Core | 1127
+
+1
-

What about this solution?

Comments

vnovotny:

Thanks a lot.

5 years ago