bcosca / fatfree

A powerful yet easy-to-use PHP micro-framework designed to help you build dynamic and robust Web applications - fast!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

breakin in the middle of a <repeat> loop in an F3 template file.

eliargon opened this issue · comments

in php I can break of a foreach( loop with break;
if there an exquivalent code when in a template code with F3 $this->tpl->render(...)?

I don't think there's a <break /> tag you could use directly.

What I do is filter my arrays before rendering them, and only passing the relevant data to the view.
Alternatively, I also use <check> inside of the loop if I need to change the output.

Using <check> you could essentially let the rest of the loop run w/o rendering any output, and even though it won't break out of the loop, you'd have a similar result.

Thanks. That's what I did, but I toght it was cumbersome. Well.... It is still a great template engine.