简体   繁体   English

将 controller 添加到 Prestashop 模块

[英]Add controller to Prestashop module

I am using the payment module that puts prestashop in GitHub as an example, but when adding a new controller I get the following error:我正在使用将 prestashop 放入 GitHub 的支付模块作为示例,但是在添加新的 controller 时出现以下错误:

Uncaught Error: Class 'paymentexampleMyControllerModuleFrontController' not found in /opt/bitnami/apps/prestashop/htdocs/classes/controller/Controller.php:208

Check the builder which is shown as follows:检查生成器,如下所示:

    $this->ps_versions_compliancy = array('min' => '1.7', 'max' => _PS_VERSION_);
    $this->author = 'PrestaShop';
    $this->controllers = array('validation', 'MyController');

I already cleared cache and gave reset to the module but I keep getting the same error, I use prestashop 1.7我已经清除了缓存并重置了模块,但我一直收到同样的错误,我使用的是 prestashop 1.7

How do you declare it?你如何声明它?

It should be:它应该是:

class PaymentExampleMyControllerModuleFrontController extends ModuleFrontController

and the location should be:位置应该是:

If a legacy controller controllers/front.如果是旧版 controller 控制器/前端。

If a Symfony controller src/controller/front如果是 Symfony controller src/controller/front

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

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