Hi,
I was looking for a way to read the current context and found the following code in the getresources snippet
$contextResourceTbl = $modx->getTableName('modContextResource');
/* multiple context support */
$modx->setLogTarget('ECHO');
if (!empty($context)) {
$context = explode(',',$context);
$contexts = array();
foreach ($context as $ctx) {
$contexts[] = $modx->quote($ctx);
}
$context = implode(',',$contexts);
unset($contexts,$ctx);
} else {
$context = $modx->quote($modx->context->get('key'));
}
I can understand the "else" part but I’m not sure what’s done in the first branch of the "if".
Looks like there is a possibility to have multiple context at the same time but why would you need that. How would it work?
Thanks