$this->xpdo->lexicon->load('tv_widget');
$properties = array(
'tpl'=>'schauspielerJsonList',
'parents'=>'2'
);
$jsonString = $modx->runSnippet('getResources', $properties);
//$jsonString = '{"name":"Arnold","id":"123"}';
$elements = json_decode($jsonString);
return 'elem: '.$jsonString;
{"name":"[[+pagetitle]]","id":"[[+id]]"}
$this->xpdo->lexicon->load('tv_widget');
$parent = $modx->getObject('modResource',2);
$children = $parent->getMany('Children');
if (empty($children)) { return; }
$list = array();
foreach ($children as $child) {
$list[] = array(
'name' => $child->get('pagetitle'),
'id' => $child->get('id'));
}
return $modx->toJSON($list);<?php
$this->xpdo->lexicon->load('tv_widget');
$properties = array(
'tpl'=>'schauspielerJsonList',
'parents'=>'2'
);
$local_where = array(
'name'=>'Arnold',
'id'=> '123',
};
$properties['where'] = $modx->toJSON($local_where);
return 'Elem: ' . $modx->runSnippet('getResources', $properties);