Checking document level in Evolution CMS

How to check document depth in MODX? "Level" snippet is here to help!

<?php
$id = $modx->documentIdentifier;
$output = count($modx->getParentIds($id));
return $output;
?>

After calling snippet you will get number that identifies current document level in site structure.
For example you are now on level 2 and that can be confirmed by checking URL: 
en/blog/modx-evo-checking-document-level = 0/1/2