简体   繁体   English

Shopware插件

[英]Shopware plugin

I am trying to create a basic plugin in the shopware I have also added the code from the reference site of the shopware. 我正在尝试在购物软件中创建一个基本插件,我还从购物软件的参考站点添加了代码。 The plugin is also available in the shopware backend. 该插件也可在shopware后端中使用。 But when i try to post the url http://localhost/shopware/RoutingDemonstration on my browser it is redirecting to the homepage only. 但是,当我尝试在浏览器上发布URL http:// localhost / shopware / RoutingDemonstration时 ,它仅重定向到主页。 No error nothing is shown even if I add anything after the url it is redirecting to the home page not on 404 page. 没有错误,即使我在URL重定向到主页(不在404页上)之后添加任何内容,也不会显示任何内容。

The default behavior of a 404 is a redirect to the homepage. 404的默认行为是重定向到首页。 So it seems that your controller is not registered correctly. 因此,看来您的控制器未正确注册。 You need to show us some source code to understand your issue. 您需要向我们展示一些源代码以了解您的问题。 Perhaps your Subscriber does not work? 也许您的订阅服务器不起作用?

There is a full example on how to do this in the documentation: https://developers.shopware.com/developers-guide/legacy-plugin-system/#register-plugin-controller-with-template-in-a-subscriber 文档中提供了有关如何执行此操作的完整示例: https : //developers.shopware.com/developers-guide/legacy-plugin-system/#register-plugin-controller-with-template-in-a-subscriber

You must also add the following PHP code to your config.php file if you want to see PHP errors: 如果要查看PHP错误,还必须将以下PHP代码添加到config.php文件中:

'front' => [
    'throwExceptions' => true,
    'showException' => true
],

'phpsettings' => [
    'display_errors' => 1
],

'template' => [
    'forceCompile' => true
],

'csrfProtection' => [
    'frontend' => true,
    'backend' => true
],

'httpcache' => [
    'debug' => true
]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM