Hi,
If no template is defined for getResource the output is a string not an array.
$events = $modx->runSnippet(
'getResources',
array(
'parents' => '2',
'hideContainers' => '1',
'depth' => '3',
'includeTVs' => '1',
'includeContent' => '1',
'limit' => '0'
)
);
echo $events;
will output
string(10905) "
Array
(
[tpl] =>
[tplOdd] =>
[tplFirst] =>
[tplLast] =>
[sortby] => publishedon
[sortbyAlias] =>
[sortbyEscaped] => 0
[sortdir] => DESC
[limit] => 0
[offset] => 0
[tvFilters] =>
[depth] => 3
[parents] => 2
[includeContent] => 1 .......
I need to use the output as an array, loop through the results, make some changes and then output the result. Since the output is a string I think I need to do a reverse print_r.
Is there a way to avoid the reverse print_r by making getResources output an array?
Thank you