【问题标题】:Magento 1.1 EE - Fatal error: Class 'Mage_MyPlugin_Helper_Data'Magento 1.1 EE - 致命错误:类'Mage_MyPlugin_Helper_Data'
【发布时间】:2016-02-18 21:57:01
【问题描述】:

基本上,我为 Magento 制作了一个插件,当我安装它时,我总是从 Mage.php 收到一个致命错误,说我的课程未找到 - 这是我的 XML:

<?xml version="1.0"?>
<config>
  <modules>
    <Johnhudson_MyPlugin>
      <version>1.0.0</version>
    </Johnhudson_MyPlugin>
  </modules>
  <admin>
    <routers>
      <adminhtml>
        <args>
          <modules>
            <Johnhudson_MyPlugin after="Mage_Adminhtml">Johnhudson_MyPlugin</Johnhudson_MyPlugin>
          </modules>
        </args>
      </adminhtml>
    </routers>
  </admin>
  <global>
    <helpers>
      <johnhudson_myplugin>
        <class>Johnhudson_MyPlugin_Helper</class>
      </johnhudson_myplugin>
    </helpers>
  </global>
</config>

还有我的 Helper 类:

<?php
class Johnhudson_MyPlugin_Helper_Data extends Mage_Core_Helper_Abstract
{
}

当我尝试安装它并清除缓存时,它总是给我一个致命错误,并以某种方式将我的“Johnhudson”包名称更改为“Mage”,显示为“Mage_MyPlugin_Helper_Data”,我的帮助文件被保存为数据。 php 根据需要。

【问题讨论】:

    标签: php magento module


    【解决方案1】:

    在 helper 类声明中尝试不使用供应商,在 global -> helpers 部分中将这个 johnhudson_myplugin 更改为 myplugin

    【讨论】:

      【解决方案2】:

      我刚刚把 package_module 改成了 module

          <global>
          <helpers>
            <johnhudson_myplugin>
              <class>Johnhudson_MyPlugin_Helper</class>
            </johnhudson_myplugin>
          </helpers>
        </global>
      

      【讨论】:

        猜你喜欢
        • 2013-02-23
        • 2012-11-14
        • 2013-03-21
        • 1970-01-01
        • 2015-03-29
        • 1970-01-01
        • 1970-01-01
        • 2012-09-23
        • 1970-01-01
        相关资源
        最近更新 更多