遵循自定义 Magento 系统配置中的 Alan Storm 教程,当我尝试添加
帮助文件夹中的 Data.php 我仍然收到此错误:
fatal error :在 E:\xampp\htdocs\magento 中找不到类“Mage_Helloworld_Helper_Data”
\app\Mage.php 在第 520 行
**Alanstormdotcom\Helloworld\Helper\Data.php**
<?php
class Alanstormdotcom_Helloworld_Helper_Data extends Mage_Core_Helper_Abstract
{
}
**Alanstormdotcom\Helloworld\etc\system.xml**
<?xml version="1.0"?>
<config>
<tabs>
<helloconfig translate="label" module="helloworld">
<label>Hello Config</label>
<sort_order>99999</sort_order>
</helloconfig>
</tabs>
</config>
**Alanstormdotcom\Helloworld\etc\config.xml**
<?xml version="1.0"?>
<config>
<modules>
<Alanstormdotcom_Helloworld>
<version>0.1.0</version>
</Alanstormdotcom_Helloworld>
</modules>
<frontend>
<routers>
<helloworld>
<use>standard</use>
<args>
<module>Alanstormdotcom_Helloworld</module>
<frontName>helloworld</frontName>
</args>
</helloworld>
</routers>
</frontend>
<global>
<helpers>
<class>Alanstormdotcom_Helloworld_Helper</class>
</helpers>
</global>
</config>
我只是想学习..我知道这对你有用,但仍然帮我找到原因..我可能会错过
东西..谢谢。
最佳答案
这一点是错误的:
<global>
<helpers>
<class>Alanstormdotcom_Helloworld_Helper</class>
</helpers>
</global>
它应该是:
<global>
<helpers>
<helloworld>
<class>Alanstormdotcom_Helloworld_Helper</class>
</helloworld>
</helpers>
</global>
(
<helloworld>
标签对应于上面的module="helloworld"
)
关于configuration - 在 Magento 中添加 Data.php Helper 出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5038281/