0

I am new to magento and I wanted to try out creating custom modules. I am currently following this tutorial since I find it easy to follow, however I am encountering an error in testing if magento is really loading my config file.

instread of the "Controller file was loaded but class does not exist" I am still getting the page not found error.

Here is my app/etc/modules/CompanyName.xml

<?xml version="1.0"?>
<config>
     <modules>
        <CompanyName>
            <active>true</active>
            <codePool>local</codePool>
        </CompanyName>
     </modules>
</config>

And here is my app/local/CompanyName/Helloworld/etc/config.xml

    <?xml version="1.0"?>
    <config>
    <modules>
        <CompanyName_HelloWorld>
            <version>
                0.1.0
            </version>
        </CompanyName_HelloWorld>
    </modules>
<!-- ... -->
    <frontend>
        <routers>
            <!-- the <helloworld> tagname appears to be arbitrary, but by
            convention is should match the frontName tag below-->
            <helloworld>
                <use>standard</use>
                <args>
                    <module>CompanyName</module>
                    <frontName>helloworld</frontName>
                </args>
            </helloworld>
        </routers>
    </frontend>
<!-- ... -->

</config>

-edit- fixed error/warning logs

I looked at varien.php and remembered that the guide I followed told me to disable/comment out domain,secure,httponly. so I removed the comments and I am now not getting any warnings errors in the logs. But i still cannot make magento read my config file. =(

$cookieParams = array(
            'lifetime' => $cookie->getLifetime(),
            'path'     => $cookie->getPath(),
            'domain'   => $cookie->getConfigDomain(),
            'secure'   => $cookie->isSecure(),
            'httponly' => $cookie->getHttponly()
        );

Clearing the cache fixed the SQL error but I still can't make magento load a helloworld custom module

this is frustrating.

Community
  • 1
  • 1
rax313
  • 88
  • 2
  • 13
  • Do you have your logs turned on? Check your exception and system logs to see if there are any errors being recorded – CCBlackburn Feb 20 '12 at 05:35

2 Answers2

1

Ahhh, think I found it...I didn't see it before. The app/etc/modules/CompanyName.xml should actually be called app/etc/modules/CompanyName_HelloWorld.xml and the XML element after modules should be changed to reflect the filename

<?xml version="1.0"?>
<config>
    <modules>
        <CompanyName_HelloWorld>
            <active>true</active>
            <codePool>local</codePool>
        </CompanyName_HelloWorld>
     </modules>
</config>
CCBlackburn
  • 1,704
  • 1
  • 12
  • 23
  • Still getting the same error message on the log and in magento. I tried looking at "app/etc/modules/Phoenix_Moneybookers.xml" and test it by http://127.0.0.1:85/magento/index.php/moneybookers and it gave me a not found message as well. – rax313 Feb 20 '12 at 07:15
  • Hmmm...are they both active in the Admin area? – CCBlackburn Feb 20 '12 at 07:42
  • yes. I checked on advanced->disabled modules output. when they said magento had a steep learning curve..I guess this is the curve – rax313 Feb 20 '12 at 07:55
  • :) sure is...when it works it works well...when it doesn't it will consume a lot of time. Ok, I'll have a look and see what else I can come up with – CCBlackburn Feb 20 '12 at 22:21
  • Alright thanks I'll do some digging on my own and see if I can fix this. – rax313 Feb 21 '12 at 00:15
0
The app/etc/modules/CompanyName.xml should rename as app/etc/modules/CompanyName_HelloWorld.xml and the XML should be changed to reflect the filename

<?xml version="1.0"?>
<config>
    <modules>
        <CompanyName_HelloWorld>
            <active>true</active>
            <codePool>local</codePool>
        </CompanyName_HelloWorld>
     </modules>
</config>

And the /app/code/local/CompanyName/HelloWorld/etc/config.xml should be:

<config> 
    <modules>
        <CompanyName_HelloWorld>
            <version>0.0.1</version>
        </CompanyName_HelloWorld>
    </modules>
     <frontend>
                <routers>
                    <helloworld>
                        <use>standard</use>
                        <args>
                              <module>CompanyName_HelloWorld</module>
                              <frontName>helloworld</frontName>
                        </args>
                    </helloworld>
                </routers>
     </frontend>
</config>
Needhi Agrawal
  • 1,326
  • 8
  • 14