php - 问题安装 prestashop 模块 : mymodule(class missing in/. ..)

标签 php prestashop

我是 prestashop 模块开发的新手,我似乎无法让它工作。我一步一步地按照教程进行操作,但是当我安装模块时,我总是得到这个“Mymodule(/modules/Mymodule/test-module.php 中缺少类)”。

我在网上查了一下,似乎当 php 文件不是用没有 BOM 的 UTF-8 编码时会发生这个错误,但即使这样做也不起作用。

这是我的代码,希望有人能找到问题所在:

<?php
if (!defined('_PS_VERSION_'))
exit;

class CookiesPresta extends Module {
  public function __construct() {
   $this->name = 'CookiesPresta';
   $this->tab = 'front_office_features';
   $this->version = '1.0';
   $this->author = 'me myself';
   $this->need_instance = 0;
   $this->ps_versions_compliancy = array('min' => '1.5');
   $this->dependencies = array();

   parent::__construct();

   $this->displayName = $this->l('Bandeau Cookies');
   $this->description = $this->l('Créez et personnalisez votre bandeau d\'information sur les cookies');

$this->confirmUninstall = $this->l('Voulez vous désinstaller le module Bandeau Cookies');

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


public function install() {
 if (!parent::install()
        || !$this->registerHook('displayHeader')
        || !$this->registerHook('displayFooter')
    )
        return false;
    return true;
}

public function uninstall() {
   if(parent::uninstall())
      return false;
 return true;
}
}
?>

最佳答案

如果你的模块的类名是 CookiesPresta 你应该命名目录 /cookiespresta 和你的类文件 /cookiespresta/cookiespresta.php>/p>

关于php - 问题安装 prestashop 模块 : mymodule(class missing in/. ..),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35128599/

相关文章:

php - Windows 10 上的 WordPress

php - Windows Azure SDK for PHP 中列出的容器

php - 使用数据透视表按类别 ID 获取产品

php - Wordpress:将事件类添加到 $parent_title

seo - 查看详细说明后如何更改 H1

css - 删除顶部菜单 Prestashop 中的双边框

php - Prestashop 中的主页模板?在哪里?

javascript - 从 Access 到 MySQL 的 SQL 查询转换

php - 在 Prestashop 1.7 的管理产品页面中添加新字段的正确方法

module - Prestashop 1.6 - 后台 - Smarty - 创建一个制作简单空白页面的模块?