Search code examples
phphtmllanguage-translationfat-free-framework

Using HTML in Fat-Free-Framework .ini files


I use Fat Free Framework with a .ini file languages dictionary. Now some languages require a different layout or HTML in a translation.

If I use HTML in my .ini file, Fat Free simply (and logically) prints the HTML code instead of the parsed HTML.

What I'm looking for is something like this:

English language:
my_text_block = Go to <a href="something">Something</a> to do something.

Dutch language:
my_text_block = Instead of a href I might want a <ul>here</ul>

Should I use another translation setup than .ini files? How can I achieve this?


Solution

  • F3 automatically escapes every output. To prevent this, you have print the "raw" output like this:

    {{@my_text_block|raw}}
    

    Alternatively, you can set ESCAPE to false (Default: true) which disables escaping everywhere. I don't really recommend this way though.

    See http://fatfreeframework.com/views-and-templates#DataSanitation