On 20-08-2008 at 16:53:04 tarjei <[EMAIL PROTECTED]> wrote:

I got a situation where I want the user to be able to define a header
based on some of the variables in my template.

Simple example:

I got the variables date (02.02.08), title (mytitle) and number(3) added
to the template, as well as the titleTemplate variable.

titleTemplate is a string containing the value "${date} ${title}".

I would like the template
<html><body><h1>${titleTemplate}</h1></body></html>
to be expanded to:
<html><body><h1>02.02.08 mytitle</h1></body></html>

Is this possible?

No. This would be a security risk, becase TALES paths not only read variables, but can also execute PHP code.

You can write your own, secure function for that:

<h1>${php:userVariables(titleTemplate)}</h1>

or just handle that entirely in PHP before passing data to templates.

--
regards, Kornel

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

Reply via email to