Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Break loop #44

Open
alexbezhan opened this issue May 15, 2012 · 3 comments
Open

Break loop #44

alexbezhan opened this issue May 15, 2012 · 3 comments

Comments

@alexbezhan
Copy link

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){ <li>...</li> } else {
    break; }
    `

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

    @alexbezhan
    Copy link
    Author

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

    @mayan31370
    Copy link
    Contributor

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

    @alexbezhan
    Copy link
    Author

    Thanks much.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants