Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.

Commit

Permalink
add getAncestor method
Browse files Browse the repository at this point in the history
  • Loading branch information
devthejo committed Jan 26, 2016
1 parent 4da9d52 commit 9237585
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Markup.php
Original file line number Diff line number Diff line change
Expand Up @@ -1518,5 +1518,13 @@ function __clone(){
}
}
}
function getAncestor(){
$ancestor = $this;
do{
$ancestor = $ancestor->parent;
}
while($ancestor->parent);
return $ancestor;
}
}
Markup::initialize();

0 comments on commit 9237585

Please sign in to comment.