Author Topic: templaning without htmpspesialschar()  (Read 1746 times)

0 Members and 1 Guest are viewing this topic.

Alexandre

  • Guest
templaning without htmpspesialschar()
on: Mon, 01. August 2005 - 16:26:42
Hi everobody,

I have next problem:

I must make following output <span style=color: #FF00FF>hamburger</span>
but template engine make htmpspacialchars() and i have &lt; instead <

may be exist special options on/off htmpspacialchars() functions

Alexandre

  • Guest
templaning without htmpspesialschar()
Reply #1 on: Mon, 01. August 2005 - 16:55:33
i find the solution

<TMPL_VAR NAME="USAGE_EXAMPLE_MARK" escape="none">

Offline ClausVB

  • Administrator
  • Hero Member
  • *****
  • Posts: 566
    • Homepage: clausvb.de
templaning without htmpspesialschar()
Reply #2 on: Wed, 03. August 2005 - 12:34:14
Quote
<TMPL_VAR NAME="USAGE_EXAMPLE_MARK" escape="none">
This is one solution. You can enable parsing in your "vlibIni.php".

See
/forum/index.php/topic,71
and
http://vlib.sourceforge.net/index.php/vlibTemplate%3AOptions

Quote
DEFAULT_ESCAPE - when using the template in an html-based application you should escape most of the string passed into the template using htmlspecialchars(). This option will allow you to specify a default escape type for all of your <tmpl_var>s. To overwrite this option, you can either use a different setting when instantiating vlibTemplate using the options array, or on per tag basis i.e. <tmpl_var name="varname" escape="url">. The following values are all possible escape values. NB: more escape attributes may be added in the future.

HTML - html escapes a string.
URL - url escapes a string.
RAWURL - rawurl escapes a string.
SQ - escapes single quotes in a string.
DQ - escapes double quotes in a string.
NONE - turns off escaping.
1 - alias for html escaping.
0 - alias for NONE. (1 and 0 are for compatibility with Perls HTML::Template).
HEX - hex encodes a string.
HEXENTITY - encodes a string to hex entities.
Regards,
Claus