i have this code:
for($j=1; $j<=1; $j++){
if(!empty($row["poza".$j])) {
$picx_mic= $thumb."?src=../media/foto_news/".$row["poza".$j]."&w=80";
$picx= "../media/foto_news/".$row["poza".$j]."&w=500";
${"x2_".$j} = "<img src='".$picx_mic."' onclick='open_view(\\"".$picx."\\",\\"".$row["titlu"]."\\")' style='cursor:pointer;' title='".$row["titlu"]."' />";
${"POZA_".$j} = ${"x2_".$j};
}else {
${"POZA_".$j} = '<img src="" width="80" />';
}
$xtpl->assign("POZA$j", ${"POZA_".$j});
}
how can i transform this in flourish stye to be like
foreach ( $details as $detail ) {
for($j=1; $j<=1; $j++){
if(!empty($detail->getIdNews().......$j)) {