Hi there,

I'm new to PHPTAL and i'm very impressed of it. but one thing is a bit annoying ...


I use different templates like index.html, header.html, etc and this worked for me:

[code]
$tpl = new PHPTAL('index.html');
$header = new PHPTAL('header.html');
$tpl->set('header', $header->execute());
echo $tpl->execute();
[/code]

But theres a problem with the html tags in header.html. e.x: <div> isn't handled as html tags, it only prints <div> in index.html. Because the < and > are converted into "&lt;" and "&gt;" ... is there a way to omit this?

i have created a function
[code]
function wp_entities($string){
        $original = array("&amp;","&lt;","&gt;","&quot;","&nbsp;");
        $entities = array("&","<",">","'"," ");
for ( $x = 0; $x < count($original); $x++ ) $string = str_replace($original[$x], $entities[$x], $string);
        return $string;
}
[/code]
that worked for me:
[code]
$tpl = new PHPTAL('index.html');
$header = new PHPTAL('header.html');
$tpl->set('header', $header->execute());
echo wp_entities($tpl->execute());
[/code]

but i think this is a ugly solution and there must be a better way ...

--
Thias Jacob
Mail - MSN
[EMAIL PROTECTED]

_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to