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