Skip to content

Instantly share code, notes, and snippets.

@aisteron
Created January 23, 2019 09:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aisteron/f2155feaca8591fedabac58f52280ceb to your computer and use it in GitHub Desktop.
Save aisteron/f2155feaca8591fedabac58f52280ceb to your computer and use it in GitHub Desktop.
getCollection Modx
$where = array(
'parent' => 6
);
$resources = $modx->getCollection('modResource',$where);
$output = '<p>Всего ресурсов: '.count($resources).'</p>';
foreach ($resources as $k => $res) {
$output .= '<p>['.$k.'] => '.$res->get('pagetitle').'</p>';
}
print $output;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment