Skip to content

Commit

Permalink
Merge pull request #4 from DreamSpawn/misc-fixes
Browse files Browse the repository at this point in the history
fixed error due to unset values in foreach
  • Loading branch information
DreamSpawn committed Nov 24, 2019
2 parents e7270e2 + 8862701 commit f1296b3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions include/templates/index/main.phtml
Expand Up @@ -80,9 +80,15 @@ $this->registerLateLoadJS('index.js');
</ul>
<h3>Mad udleveret:</h3>
<ul>
<?php foreach ($this->food_data['received'] as $type => $count) :?>
<li><strong><?= e($type);?>:</strong> <?= e($count);?></li>
<?php endforeach;?>
<?php
if (isset($this->food_data['received'])) {
foreach ($this->food_data['received'] as $type => $count) {
?>
<li><strong><?= e($type);?>:</strong> <?= e($count);?></li>
<?php
} // end if
} // end foreach
?>
</ul>
</div>

Expand Down

0 comments on commit f1296b3

Please sign in to comment.