1

I am using Latte framework to generate Email templates in my application. I don't need escaping in variables used in template because I use it for inline CSS styling that escaping incorrectly. To avoid escaping I need to use:

{$style['.ei-section-rows-wrapper']|noescape}

I have a lot of tags with inline styles and adding "|noescape" everywhere breaks readability of HTML template file.

Is this possible to globally set some configuration for Latte framework to NOT escape anything in my template? I assume I can set some params after this code:

$latte = new Latte\Engine;

// Add some custom filter to $latte to disable escaping?..

$email_template = $latte->renderToString(....);
Dmitry
  • 499
  • 1
  • 3
  • 19

2 Answers2

0

I am afraid that there is no official way how to turn off auto-escaping in Nette framework yet.

Milan Kyncl
  • 11
  • 1
  • 4
0

{contentType text} turns off escaping completely; see https://latte.nette.org/en/tags#toc-contenttype

desertnaut
  • 57,590
  • 26
  • 140
  • 166
Makkapitew
  • 11
  • 4