|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
andyi Smarty n00b
Joined: 06 Apr 2018 Posts: 1
|
Posted: Fri Apr 06, 2018 6:49 pm Post subject: foreach with {continue} in new block |
|
|
I just upgraded to version 3.1.31 and think I've identified a bug.
If I use a {foreach} loop and put a {continue} within a sub block, the fetch will fail with error message "Fatal error: 'continue' not in the 'loop' or 'switch' context in ..."
Am I missing something or is this an intended limitation?
Example:
Code: | {foreach $var_array as $var_val}
{block name=subblock}
{continue}
{/block}
{/foreach}
|
|
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Fri Apr 06, 2018 7:39 pm Post subject: |
|
|
It is intended behavior. Blocks are compiler-level elements, {continue} is runtime.
Same as if you #ifdef your continue in C code.
Works as intended, but you should really never do it. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|