public function iterate($iterator, &$allItems) { while ($iterator->valid()) { $key = $iterator->key(); $current = $iterator->current(); if ($iterator->hasChildren()) { $this->iterate($iterator->getChildren(), $allItems); } else { if ($current['activable'] === true) { $allItems[] = \vendor\DataPath::getPath(); } } $iterator->next(); } }
public function current() { \vendor\DataPath::setPath($this->key(), $this->level); $current = $this->data[$this->key()]; return array('title' => $current['title'], 'href' => $current['href'], 'style' => $current['style'], 'img' => $current['img'], 'cls' => $current['cls'], 'activable' => $current['activable']); }