Answer the question
In order to leave comments, you need to log in
How to get parameters/settings from all contexts in MODx?
Created a plugin that fires on the "OnHandleRequest" event.
I make a request like this:
$contexts = $modx->getCollection('modContext', array('key:NOT IN' => array('web', 'mgr')));
foreach($contexts as $cx) {
$modx->log(modX::LOG_LEVEL_ERROR, $cx->key);
}
$cx->getOption('http_host')
Answer the question
In order to leave comments, you need to log in
It is possible to pull all settings directly from the modx_context_setting table.
$cs = $modx->getCollection('modContextSetting');
foreach($cs as $csi){
print_r($csi->toArray());
}
To get context settings, you need to “prepare” this context
if($cx->prepare()) {
print_r($cx->config);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question