Velocity template - foreach loop
已回答
Hi,
I'm trying to modify the default PHP constructor template to have a multiline constructor instead of a single line one.
I came up with this code which only displays one parameter and doesn't display the body of the constructor... It seems to stop at the #end instruction
Can somebody help ?
/**
* ${CLASS_NAME} constructor.
${PARAM_DOC}
${THROWS_DOC}
*/
public function __construct(
#foreach ($param in $PARAM_LIST.split(","))
$param
#end
) {
${BODY}
}
请先登录再写评论。
Please try
Works great! Thanks!