About break
foreach ( $data as $k => $v ) {
if ( $k == 4 ) {
break;
}
}
every one knows.
Is there something similar in Smarty
's or Dwoo
's {foreach}
function ?
About break
foreach ( $data as $k => $v ) {
if ( $k == 4 ) {
break;
}
}
every one knows.
Is there something similar in Smarty
's or Dwoo
's {foreach}
function ?
You should put your logic in php, not in template. However, you can write your won compiler plugin:
function smarty_compiler_break($contents, &$smarty){
return 'break;';
}
and save it to compiler.break.php
in your plugins directory.
Now in template you can use {break}
.