Skip to content

Instantly share code, notes, and snippets.

@helios-ag
Created April 21, 2012 00:39
Show Gist options
  • Save helios-ag/2432884 to your computer and use it in GitHub Desktop.
Save helios-ag/2432884 to your computer and use it in GitHub Desktop.
Recursive walk
private function walk($menu)
{
foreach ($menu->getChildren() as $childNode) {
if($childNode->hasChildren())
{
$childNode->setAttribute('class','dir');
}
$this->walk($childNode);
}
return $menu;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment