Shopware后端extjs问题。
我有任务要在插件配置窗口上实现按钮,该按钮将在后端控制器上发送请求。所以我实现了按钮: screenshot
并编写了执行ajax的代码:
<?xml version="1.0" encoding="utf-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/shopware/shopware/5.3/engine/Shopware/Components/Plugin/schema/config.xsd">
<elements>
<element type="button">
<name>Connect</name>
<label lang="de">Verbinde</label>
<label lang="en">Connect</label>
<options>
<handler>
<![CDATA[
function () {
Ext.Ajax.request({
method: 'POST',
url: 'UserData/getTokens',
params: {
request: 'request'
},
success: function (res) {
}
});
}
]]>
</handler>
</options>
</element>
</elements>
</config>
当我单击按钮时,apache日志中显示状态500和消息:
调用未定义的方法Shopware_Proxies_ShopwareControllersBackendEtsyUserDataProxy :: setFront()
那么,是否有编写此请求的正确方法,或者我误解了某些内容? 还是一个错误?