MODX Services
Last updated Sep 2nd, 2026 | 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
$204 per month—let's make that $500!
Learn moreWhat is a Service?¶
A service is any object stored in the dependency injection container ($modx->services). In 2.x, and still in 3.x, many extras also load services with $modx->getService. That helper is deprecated in 3.x. Prefer has / add / get on $modx->services.
Once a service is in the container, you can also hang it on $modx yourself ($modx->error = $modx->services->get('error')). getService did that automatically.
$modx->services->add('twitter', function($c) use ($modx) {
return new MyPackage\Twitter($modx, ['api_key' => 3212423]);
});
$modx->services->get('twitter')->tweet('Success!');
What are the Default Included Services?¶
A list of the core-included MODX Services is as follows:
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
$204 per month—let's make that $500!
Learn more










