<? foreach ($this->criteria as $key => $value): ?>
<li><?= $this->accommodationsLink($this->criteria, $key) ?></li>
<? endforeach ?>
This code give unexpected results, because only one link is visible. But there are two items in $this->criteria.
I explored the cause of the probleem. In the function accommodationsLink is another foreach loop that works on the same criteria object
foreach ($criteria as $key => $value) {
$params[$key] = $value;
}
$this->criteria and $criteria are the same object that implements the php Iterator interface. Is there a simple way to let this code work or are nested foreach loops not possible with php iterator interface?