modX.reloadContext
Last updated not available | Page history | Improve this page | Report an issue
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn moremodX::reloadContext¶
Without $key, it regenerates the current Context through modX::_initContext() and refreshes the + config placeholders. With $key, it loads that Context into modX::$contexts — even one that was never loaded — and does not switch to it.
Returns false when no Context is initialized and no key was given. The Resource Update processor calls it from cleanup() after a Resource was saved, unless the _reloadContext property is false.
Syntax¶
boolean reloadContext ([string $key = null])
-
$key(string) Context to (re)load; by defaultnullreloads the current one
Example¶
$modx->reloadContext(); // refresh the Context in use
$modx->reloadContext('mgr'); // load another Context, stay where we are
See Also¶
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn more










