[ 
https://issues.apache.org/jira/browse/VELOCITY-711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679813#action_12679813
 ] 

Byron Foster commented on VELOCITY-711:
---------------------------------------

I've played with dynamic scoping over lexical scoping in the 2.0exp branch, and 
yea, I think dynamic scoping is more appropriate for VTL, and in a world of 
block macros, falls out much nicer.


> Add a #scope directive for modifying scope behavior
> ---------------------------------------------------
>
>                 Key: VELOCITY-711
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-711
>             Project: Velocity
>          Issue Type: New Feature
>          Components: Engine
>            Reporter: Byron Foster
>             Fix For: 1.7
>
>
> A propose adding a #scope block directive that would take a context as an 
> argument, and all VTL within the #scope block would be executed using the 
> given scope.  The need for this directive comes up when using block macros.   
> For example I may want the $bodyContent of the macro to be executed in the 
> outer scope of block macro.  Take the following case:
> #for($bank in $banks)
>   #...@lineitem() $bank.name #if(!$bank.solvent)<b>Bankrupt</b>#end #end
> #end
> #macro(lineItem)
>   #scope($macro.outer)<div class="lineItem">$bodyContent</div>#end
> #end

-- 
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]

Reply via email to