Subst.pm
NAME
Communiware::DE::Subst - Dynamic element Subst
SYNOPSIS
<:Subst string [operator string]:>
DESCRIPTION
Substitutes attribute values into given string(s)
and performs various
operations on this string before outputting them as target html.
Function of Subst is almost same as of Attr, but since dymanic elements are not allowed in the middle of HTML tags, you sometimes need to perform attribute substitution on complete tag. Attr is not suited well for it, although you can play with printf format. But if you have to substitute two attributes inside one tag, say img src and alt, you are in trouble.
Subst is specially designed for such cases,
Example:
<:Subst "<img src=\"icon_@{TYPE_ID}.gif\" alt=\"@{ITEM_TYPE}\":>
If there is more than one arguments passed to subst, these arguments are passed to expession engine after attribute substitution is done.
See Communiware::Expr documentation for more information. See Communiware::Context documentation for more details on an attribute substitution.
This dynamic element doesn't perform html escaping of values.
INTERNALS
compile
$code = Communiware::DE::Subst::compile($frag,@args);
Returns compiled template code and alters list of used attributes in $ctx