branaway / Japid

A Java-based statically-typed fast template engine that can be used in any Java code. It has special adapter for use with the Play! Framework.
113 stars 18 forks source link

Break loop #44

Open alexbezhan opened 12 years ago

alexbezhan commented 12 years ago

Hi and thank you for great plugin. I faced the following issue. I have the 'for' loop and want to break it(use 'break' keyword) like following:

for Ingredient ingredient: ingredients ingredient.product.get(); if (_index < 4 || ingredients.size() == 4) {

  • ${ingredient.product.name}
  • `} else if (_index == 4){

  • ...
  • } else { break; }

    AFAIK 'for' loop generates render method callback. How can I break it ? Thanks.

    alexbezhan commented 12 years ago

    Sorry maybe it would be better to use gist for code example: https://gist.github.com/2699837

    mayan31370 commented 12 years ago

    You can use "return" instead, but do remember there must be no space between the "}" and "return".

    alexbezhan commented 12 years ago

    Thanks much.