Skip to content

Instantly share code, notes, and snippets.

@jcamachott
Last active August 29, 2015 14:25
Show Gist options
  • Save jcamachott/031e60748bb06314758d to your computer and use it in GitHub Desktop.
Save jcamachott/031e60748bb06314758d to your computer and use it in GitHub Desktop.
hasChildren
<?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