3. Convert of special characters to XML entities

By default, special characters such as '<', '>', '&', ''' and '"' in model data is converted to XML entities when display. To stop the convert in any part of data, set names of key you want to stop the convert with setNoEscapeVars() method. For example, PHP code is:

$body_html = '<b>ZOGAN</b> is a template engine for <i>XML</i>';
$model_data = array(
  'title' => 'Hello World',
  'body'  => $body_html,
  'body_html'  => $body_html
);
$tmpl->setNoEscapeVars(array('body_html'));
$tmpl->display($model_data);
   

And the template is:

<body>
  <h1 var:cont="{title}">title will be inserted here</h1>
  <p var:cont="{body}">body text will be inserted here</p>
  <p var:cont="{body_html}">body html will be inserted here</p>
</body>
   

So, the output will be:

  <body>
    <h1>Hello World</h1>
    <p>&lt;b&gt;ZOGAN&lt;/b&gt; is a template engine for &lt;i&gt;XML&lt;/i&gt;</p>
    <p><b>ZOGAN</b> is a template engine for <i>PHP</i></p>
  </body>