You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Claude Brisson (JIRA)" <de...@velocity.apache.org> on 2010/03/30 04:57:27 UTC
[jira] Closed: (VELOCITY-666) Blockmacro support (allows any AST as
macro body argument)
[ https://issues.apache.org/jira/browse/VELOCITY-666?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claude Brisson closed VELOCITY-666.
-----------------------------------
Resolution: Fixed
Ok. Not saying that I'm convinced by the syntax, but looks like I've no alternative (except always sticking to #define to declare the block).
> Blockmacro support (allows any AST as macro body argument)
> ----------------------------------------------------------
>
> Key: VELOCITY-666
> URL: https://issues.apache.org/jira/browse/VELOCITY-666
> Project: Velocity
> Issue Type: Improvement
> Affects Versions: 1.6.2, 1.7
> Reporter: Jarkko Viinamäki
> Fix For: 1.7
>
> Attachments: velocity-blockmacro.patch, velocity-call-directive.patch
>
>
> Inspired by VELOCITY-583 (BlockMacro support) I implemented the same functionality in a slightly different way.
> The new syntax is:
> #@yourMacroName($arg1 $arg2) any valid velocity AST here #end
> so basically the syntax is exactly the same as for normal macros except you put that @ prefix to the macro name. That tells Velocity that there's a macro AST body that should be passed to the actual macro.
> And in the macro you can refer to the passed body 0-N times. Like:
> #macro(yourMacroName $foo $bar)
> $bodyContent
> #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: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org