Skip to content

Instantly share code, notes, and snippets.

@weaverryan
Created January 17, 2012 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weaverryan/1628952 to your computer and use it in GitHub Desktop.
Save weaverryan/1628952 to your computer and use it in GitHub Desktop.
Recursive function
public function getNameWithSpaces()
{
$category = $this;
$level = 0;
while ($category = $this->getParent()) {
$level++;
}
// now make spaces based on the level
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment