[stringtemplate-interest] Output formatting issue

ilia at obnovlenie.ru ilia at obnovlenie.ru
Wed May 18 07:11:42 PDT 2005


Independency from data type is nice, but sometimes output is to be
formatted.
Escaping ( < -> &lt; etc.) is a programmer-controlled feature, but other
formatters may need designer's control.

For example, date in the form of UNIX timestamp should be formatted
according to designers' needs.
In existing templates that can be something like 
{$date|date_format:"Y/m/d"}

Or a long "topic header" is to be truncated to 40 symbols and then "..." is
added at the end if it was truncated
{$header|truncate:40:"..."}.

The whole issue is about "variable modifiers" that are to be managed by
designers.
A programmer should not embed such things into code, because they refer to
view rather than model.

Does StringTemplate support anything like that?



More information about the stringtemplate-interest mailing list