modX.initialize
Last updated Apr 6th, 2019 | 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::initialize¶
Initializes MODX engine into a Context.
This includes preparing the session, pre-loading some common classes and objects, and loading the current site and context settings. It also runs initialization classes that extension packages register to override session handling, error handling or other initialization.
Syntax¶
boolean initialize ([string $contextKey = 'web'], [array|null $options = null])
-
$contextKey(string) Indicates the context to initialize -
$options(array|null) An array of options for the initialization
Returns true if the context was initialized successfully, or was already initialized; false otherwise:
if (!$modx->initialize('web')) {
// initialization failed
}
Example¶
Initialize the 'sports' Context.
$modx->initialize('sports');
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










