Author: nbubna
Date: Tue Sep 2 16:25:41 2008
New Revision: 691429
URL: http://svn.apache.org/viewvc?rev=691429&view=rev
Log:
VELOCITY-612 document #break in user guide
Modified:
velocity/engine/trunk/xdocs/docs/user-guide.xml
Modified: velocity/engine/trunk/xdocs/docs/user-guide.xml
URL:
http://svn.apache.org/viewvc/velocity/engine/trunk/xdocs/docs/user-guide.xml?rev=691429&r1=691428&r2=691429&view=diff
==============================================================================
--- velocity/engine/trunk/xdocs/docs/user-guide.xml (original)
+++ velocity/engine/trunk/xdocs/docs/user-guide.xml Tue Sep 2 16:25:41 2008
@@ -1457,6 +1457,21 @@
directive.foreach.maxloops = -1
]]></source>
+ <p>
+ If you want to stop looping in a foreach from within your template,
+ you can now use the #break directive to stop looping at any time:
+ </p>
+
+<source><![CDATA[
+## list first 5 customers only
+#foreach( $customer in $customerList )
+ #if( $velocityCount > 5 )
+ #break
+ #end
+ $customer.Name
+#end
+]]></source>
+
</section>
<section name="Include" href="include">