Alright, I’ve tried almost anything I could find right now and I still can’t get it to work. I now get the "Access Denied" message inside the JSON response. It feels like somewhere in the manager I need to set some access variables...
I’ve got the following Ext:
Ext.Ajax.request({
url: '/modx/assets/components/mycmp/connector.php',
method: 'POST',
success: function(response, opts) {
alert(response.responseText);
},
failure: function(response, opts) {
alert('Fail');
},
params: {
'action': 'fetch',
'ctx': 'web'
}
});
Inside this component I’ve got two locations, the assets and the core components folder. So that would be:
/modx/assets/components/mycmp/connector.php
/modx/core/components/mycmp/.*
Inside the connector.php file I’ve got:
<?php
$basePath = dirname(dirname(dirname(dirname(__FILE__))));
require_once $basePath . '/config.core.php';
require_once MODX_CORE_PATH . 'config/' . MODX_CONFIG_KEY . '.inc.php';
require_once MODX_CONNECTORS_PATH . 'index.php';
$modx->handleRequest(array(
'processors_path' => $modx->getOption('core_path').'components/mycmp/processors/',
'location' => ''
));
Inside the core component folder from mycmp I’ve got:
/processors/fetch.php
/index.php
/mycmp.php
Now the fetch.php doc simply says:
<?php
return array('message' => 'Trying something out!');
Nothing fancy, but still no cigar. I do not need some quick fix by setting it into some resource and calling that, I need the core method, because a
much larger project will be based on this. I’ve got the namespaces defined, I’ve done the modMenu and modAction stuff...
Anybody got a clue as to what I am doing wrong?
/edit
Oh yea, the return format:
{"success":false,"message":"Access denied.","total":0,"data":[],"object":[]}