gpt4 book ai didi

configuration - 在 Magento 中添加 Data.php Helper 出错

转载 作者:行者123 更新时间:2023-12-04 07:40:14 25 4
gpt4 key购买 nike

遵循自定义 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com