Created
June 3, 2019 07:51
-
-
Save qwertik17/43f20bd86406854e7df8630fa7740302 to your computer and use it in GitHub Desktop.
webconnector for ajax requests in frontend
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/config.core.php'; | |
require_once MODX_CORE_PATH . 'model/modx/modx.class.php'; | |
$modx = new modX(); | |
$modx->initialize('web'); | |
$modx->getService('error', 'error.modError', '', ''); | |
$path = MODX_CORE_PATH.'components/ajax/processors/web/'; | |
$response = $modx->runProcessor($_REQUEST['action'], $_REQUEST, array( | |
'processors_path' => $path | |
)); | |
$json = $modx->toJSON($response->response); | |
echo $json; | |
@session_write_close(); | |
exit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment