Created
April 6, 2013 14:20
-
-
Save gbili/5326266 to your computer and use it in GitHub Desktop.
AbstractContainer Trying to get all the branch of the current active page (all parent pages too)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Zend\Navigation\AbstractContainer | |
... | |
public function getActiveBranch() | |
{ | |
$found = array(); | |
$iterator = new RecursiveIteratorIterator($this, RecursiveIteratorIterator::SELF_FIRST); | |
foreach ($iterator as $page) { | |
if ($page->isActive(true)) { | |
$found[] = $page; | |
} | |
} | |
return $found; | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment