[
https://issues.apache.org/jira/browse/VELOCITY-509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Will Glass-Husain resolved VELOCITY-509.
----------------------------------------
Resolution: Fixed
Implemented, though still need to write the user docs.
A good example:
#set($vtl = 'learn the alphabet $test1')
#set($test1 = "abc")
#evaluate($vtl)
#set($test1 = "xyz")
#evaluate($vtl)
will display (removing blank lines).
learn the alphabet abc
learn the alphabet xyz
Note that the reference "$vtl" needs single quotes to avoid evaluating $test1
up front.
> Add new directive #evaluate
> ---------------------------
>
> Key: VELOCITY-509
> URL: https://issues.apache.org/jira/browse/VELOCITY-509
> Project: Velocity
> Issue Type: New Feature
> Components: Engine
> Affects Versions: 1.5 beta2
> Reporter: Will Glass-Husain
> Priority: Minor
> Fix For: 1.6
>
>
> On a separate issue (VELOCITY-504) we came up with the idea of a new
> directive, #evaluate. Basically, it would act just like Velocity.evaluate().
>
> Users are always asking for this capability (internal evaluation). Usually
> we tell them to "use a tool". Instead, we should just put in a simple
> directive that would evaluate a VTL string using the current context.
> Incidentally, this should be the current local context, e.g. if inside a
> macro or a foreach loop (or worse, both) it should use that context. See
> VELOCITY-504 for why this is needed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]