简体   繁体   中英

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:

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

How do you declare it?

It should be:

class PaymentExampleMyControllerModuleFrontController extends ModuleFrontController

and the location should be:

If a legacy controller controllers/front.

If a Symfony controller src/controller/front

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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