Last active
August 29, 2015 14:25
-
-
Save jcamachott/031e60748bb06314758d to your computer and use it in GitHub Desktop.
hasChildren
This file contains 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 | |
/* | |
Gist: https://gist.github.com/jcamachott/031e60748bb06314758d | |
Version: 1.0.20150718 | |
hasChildren: returns 1 or 0 if specified ID has children | |
Options: | |
&id=`` // use current doc id - [[*id]] or if in tpl, use [[+id]] | |
*/ | |
$resource = $modx->getObject('modResource', $id); | |
return $resource->hasChildren() != 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment