php - 创建模块 prestashop 1.5

标签 php module e-commerce prestashop

我在 PrestaShop 1.5 中创建了一个新模块 mau文件mymodule.php内容

 <?php
  if (!defined('_PS_VERSION_'))
   exit;
 
  class myModule extends Module
   {
    public function __construct()
     {
      $this->name = 'mymodule';
      $this->tab = 'Test';
      $this->version = 1.0;
      $this->author = 'Firstname Lastname';
      $this->need_instance = 0;
 
      parent::__construct();
 
      $this->displayName = $this->l('My module');
      $this->description = $this->l('Description of my module.');
     }
 
   public function install()
    {
    if (parent::install() == false)
      return false;
    return true;
    }
   public function uninstall()
    {
    if (!parent::uninstall())

    parent::uninstall();
    }
   }
?>

但是我有一个错误信息

mymodule (erreur de syntaxe dans /modules/mymodule/mymodule.php) mymodule (classe manquante dans /modules/mymodule/mymodule.php)

你能帮帮我吗

最佳答案

当我改变页面的编码(编码为UTF-8 without BOM)时,这个问题就解决了。

关于php - 创建模块 prestashop 1.5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13857842/

相关文章:

php - 如何创建一个按用户出生日期计算 'age' 的选择查询?

php - 计算多个字段

javascript - PHP JSON header 导致 JSON.parse 出错(使用 jQuery)

module - 如何重新导出枚举?

php - 如何在登录按钮下方添加 HTML?

javascript - ReactJS - 处理文件中的多次导出 + withRouter

module - 可以注释组合的多态变体类型吗?

MySQL 选择具有属性和属性值的产品 - 分组

wordpress - 在 wordpress 站点上使用共享 SSL

c# - 找不到方法 : 'System.Collections.Generic.IList` 1<Nop. Services.Cms.IWidgetPlugin>