Connectors
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
$194 per month—let's make that $500!
Learn moreWhat a connector is¶
A connector is a PHP entry point for AJAX (and similar) requests that should run a processor. It boots MODX, checks that the user may load the context, then hands the request to modX::request->handleRequest(), which calls runProcessor.
Connectors do not change the database themselves. Processors do.
Core connector¶
Manager requests for core actions go through files under connectors/ that include connectors/index.php. That bootstrap:
- Loads the MODX instance and initializes a context (default
mgr, orctxfrom the request). - Enforces a load policy unless the action is explicitly anonymous (for example
security/login). - Sanitizes the request and routes
actionto a core processor.
Example shape of a request: your ExtJS grid posts to a connector URL with action=resource/getlist (plus auth headers MODExt adds for you).
Extra connectors¶
The core connector only knows core processor paths. Extras add their own file, typically:
assets/components/myextra/connector.php
Pattern (same idea as in Developing an Extra, Part II):
<?php
require_once dirname(__DIR__, 3) . '/config.core.php';
require_once MODX_CORE_PATH . 'config/' . MODX_CONFIG_KEY . '.inc.php';
require_once MODX_CONNECTORS_PATH . 'index.php';
$corePath = $modx->getOption(
'myextra.core_path',
null,
$modx->getOption('core_path') . 'components/myextra/'
);
// load your service / lexicon as needed …
$modx->request->handleRequest([
'processors_path' => $corePath . 'processors/',
'location' => '',
]);
processors_path tells MODX where {action}.class.php files live. The grid’s baseParams.action (for example mgr/item/getlist) maps to processors/mgr/item/getlist.class.php.
Auth and CSRF¶
Connectors expect a manager session (unless you deliberately open an anonymous action) and a site auth token. MODExt sends it as the modAuth HTTP header (or HTTP_MODAUTH in the request). The value is $modx->siteId. Do not put that value in public repositories or client-side docs.
Opening the connector URL in a browser with no session and no action usually returns JSON like success: false / access denied. That is expected.
See also¶
- Processors
- Core processor list
- Custom Manager Pages
- MODExt FormPanel: posts through a connector URL
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










