模块构造函数未加载

时间:2017-11-04 19:03:57

标签: php module prestashop-1.7

我正在开发一个PrestaShop模块,我在后台的模块部分显示模块名称和描述时遇到了困难。

我第一次在modules/目录中设置de模块,它显示正常,正确显示名称,描述,版本和作者。

但是在对代码进行一些更改后,现在它只显示模块目录的名称和里面的图标。无论我做什么,它都会显示这些信息,即使我将文件设置为原来当所有内容都显示正常时也是如此。

起初我认为这是一个缓存问题,但在禁用Advanced Parameters > Performance上的所有缓存后,它仍然只显示目录名和图标文件。我也点击了Clear Cache而没有任何内容。

<?php

if (!defined('_PS_VERSION_')) {
    exit;
}

class themegenerator extends Module
{
    function __construct()
    {
        $this->name = 'themegenerator';
        $this->tab = 'front_office_features';
        $this->version = '1.0.0';
        $this->author = 'Firstname Lastname';
        $this->need_instance = 0;
        $this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
        $this->bootstrap = true;

        parent::__construct();

        $this->displayName = $this->l('Theme Generator');
        $this->description = $this->l('This is the Theme Generator description.');

        $this->confirmUninstall = $this->l('Are you sure you want to uninstall?');

        if (!Configuration::get('MYMODULE_NAME'))
            $this->warning = $this->l('No name provided');
        }
    }
}

我还检查了文件编码(UTF-8),文件权限(644),一切似乎都没问题。我也有调试模式开但没有错误消息(除了一些翻译丢失消息)。

1 个答案:

答案 0 :(得分:0)

您是否尝试删除模块目录中的config * .xml文件?

这些文件存储模块名称和描述,以便在模块选项卡中更快地显示它们。