0
votes

I am trying to create system configuration for my module.After adding system.xml I'm getting

Fatal error: Class 'Mage_Training_Banners_Helper_Data' not found

magento/app/code/local/Training/Banners/Helper/Data.php

<?php

class Training_Banners_Helper_Data extends Mage_Core_Helper_Abstract
{

}

config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Training_Banners>
            <version>0.1.0</version>
        </Training_Banners>
    </modules>

    <frontend>
        <routers>
            <banners>
                <use>standard</use>
                <args>
                    <module>Training_Banners</module>
                    <frontName>banners</frontName>
                </args>
            </banners>
        </routers>
        <layout>
            <updates>
                <banners> 
                    <file>banners.xml</file>
                </banners>
            </updates>
        </layout>   
    </frontend>
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <banners after="Mage_Adminhtml">Training_Banners_Adminhtml</banners>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>

    <adminhtml>
        <layout>
            <updates>
                <banners>
                    <file>training_banners.xml</file>
                </banners>
            </updates>
        </layout>
    </adminhtml>

    <global>
        <blocks>
            <banners>
                <class>Training_Banners_Block</class>
            </banners>
        </blocks>

        <helpers>
            <banners>  
                <class>Training_Banners_Helper</class>
            </banners>
        </helpers>

        <models>
            <banners>
                <class>Training_Banners_Model</class>
                <resourceModel>banners_mysql4</resourceModel>
            </banners>
            <banners_mysql4>
                <class>Training_Banners_Model_Mysql4</class>
                <entities>
                    <manage>
                        <table>banners</table>
                    </manage>
                </entities>
            </banners_mysql4>
        </models>
        <resources>
            <banners_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </banners_read>
            <banners_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </banners_write>
        </resources>
    </global>
</config>

Could anyone help?

2
Please post some more code and information, so that we can help you. E.g. paths to the files, whole content of config.xml, content of Helper_Data class etc. - Simon
@Simon: Added full code. - blakcaps
Please also post the system.xml. :-) Maybe you use a module="sometag" for a translation tag there instead of module="banners"... - Simon
I removed system.xml file.Even after system->config throwing this error - blakcaps
After removing system.xml make sure your cache is cleared. Do you invoke somewhere in code this helper ? If yes how do you do it (paste code pls)? Please paste system.xml file content. Thanks - xyz

2 Answers

4
votes

Sure, Create folder Helper in your module.
Then create File Data.php in it.
File content should contain:

class Company_Module_Helper_Data extends Mage_Core_Helper_Abstract{}

that is enough to solve your issue.
FYI: This happens cause magento is trying to translate content of your tags. Translation is handlend using __() method of module helper.

3
votes

I was using "banners" group name as another module group name.So there was a conflict.