latte html variable print string

6 months ago

hsynucak
Member | 8
+
0
-

hi;
presenter string html variable latte echo problem;

sample:

presenter code :
$this->template->test = “<b>bolder text</b>”;

latte code:

{$test}

show browser : string

<b>bolder text</b>

but me do you :

bolder text

understand me?

6 months ago

Kcko
Member | 302
+
0
-

use noescape filter. Btw tvoje anglictina je fakt něco, původně jsem myslel, že se jedná o vtip.

6 months ago

Šaman
Member | 2301
+
0
-

{$test|noescape}

Kcko wrote:

use noescape filter. Btw tvoje anglictina je fakt něco, původně jsem myslel, že se jedná o vtip.

IMO he is not understand czech.

Last edited by Šaman (2018-12-17 00:57)

6 months ago

hsynucak
Member | 8
+
0
-

Šaman wrote:

{$test|noescape}

Kcko wrote:

use noescape filter. Btw tvoje anglictina je fakt něco, původně jsem myslel, že se jedná o vtip.

IMO he is not understand czech.

thank you. working this code. :)

6 months ago

japlavaren
Backer | 412
+
0
-

if you need to pass variable with html code to template with html code, you can use ` Nette\Utils\Html`

$this->template->variable =  Nette\Utils\Html::el()->sendHtml("<b>bolder text</b>");

this works also with nette forms captions and others ;)

5 months ago

hsynucak
Member | 8
+
0
-

japlavaren wrote:

if you need to pass variable with html code to template with html code, you can use ` Nette\Utils\Html`

$this->template->variable =  Nette\Utils\Html::el()->sendHtml("<b>bolder text</b>");

this works also with nette forms captions and others ;)

thank you..