Created
November 10, 2015 02:56
-
-
Save muskie9/7ac02c964250d1eb34a5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
public function CurrentLevel() { | |
$page = $this->owner; | |
$level = 1; | |
while(1) { | |
if($page->Parent) { | |
$level++; | |
$page = $page->Parent(); | |
}else { | |
return $level; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment