On 19-11-2008 at 10:38:49 Szymek Przybył <[EMAIL PROTECTED]> wrote:

What difference is between replace and content?

Replace always replaces entire tag. It's a shortcut for tal:omit-tag and tal:content at once.

In my example I want to add after "price" variable EURO sign. But maybe better way to do it is just add to "price" variable this sign in PHP, before sending it to phptal template:
<?php $price.=' &euro;'

If you use entity, then price string becomes HTML. To protect against XSS vulnerabilities PHPTAL deliberately makes outputting of raw HTML harder.

If you use literal character (in appropriate encoding, I stronly suggest UTF-8), it will work fine. It's a good idea to keep price and currency together (you could get in trouble if someone changed currency in the template without changing prices accordingly).

And better is to use entities (&euro;) or entites after parse (EUR) in php/tamplates?

It's better to use Unicode and produce standalone XML documents. That is never use entities except the basic XML ones (&lt;, &amp; and &quot;).

regards, Kornel

PHPTAL mailing list

Reply via email to