I know this is an old thread, but since noone gave a solution and google points to it, here is the solution I found:
Code:
Ext.define('myapp.direct.ZendProvider', {
alias: 'direct.zendprovider',
extend: 'Ext.direct.RemotingProvider'
});
And this is all you need to extend it.
To use it:
Code:
Ext.Direct.addProvider({
enableUrlEncode : 'extDirectData',
url : './mymodule',
format : 'json',
type : 'zend',
actions : {
index : [{
name : 'logout',
len : 0
}]
},
namespace : 'myapp.mymodule.provider'
});
To call it:
Code:
myapp.mymodule.provider.index.logout();
Also to make this code fully functional, you need to add:
Code:
Ext.Ajax.on('beforerequest', function(conn, options) {
if (options.transaction && options.transaction.provider && options.transaction.provider.type == 'zend') {
var controller = options.transaction.action;
controller = controller.replace(/([a-z])([A-Z])/g, "$1.$2").toLowerCase();
var action = options.transaction.method;
action = action.replace(/([a-z])([A-Z])/g, "$1.$2").toLowerCase();
var url = options.url;
url = url +
(url.lastIndexOf('/') == url.length-1 ? '' : '/') +
controller +
'/' +
action;
if (options.transaction.provider.format) {
url += '/format/' + options.transaction.provider.format;
}
options.url = url;
options.disableCaching = true;
}
});
This code is taken and made to work with ExtJs 4.0 from Conjoon (nice cute zend framework+extjs opensource application).