$jsonString = $modx->toJSON($A);
$params = array (
'packageName' => 'foo',
'classname' => 'foo',
'tpl' => 'myRowTpl',
'where' => '{"id:IN":$jsonString}'
);
$output = $modx->runSnippet('migxLoopCollection',$params);
This question has been answered by Bruno17. See the first response.
'where' => '{"id:IN":"' . $jsonString . '"}''where' => '{"id:IN":["42","47","48"]}'$jsonString = '["42","47","48"]';
'where' => '{"id:IN":$jsonString}''where' => '{"id:IN":"' . $jsonString . '"}'
$jsonString = '["42","47","48"]';
$params = array (
'packageName' => 'foo',
'classname' => 'foo',
'tpl' => 'myRowTpl',
'where' => '{"id:IN":' . $jsonString . '}'
);
$output = $modx->runSnippet('migxLoopCollection',$params);
$where = array('id:IN'=>array('42','47','48'));
$params = array (
'packageName' => 'foo',
'classname' => 'foo',
'tpl' => 'myRowTpl',
'where' => $modx->toJson($where)
);
$output = $modx->runSnippet('migxLoopCollection',$params);