开发者

Alan Storm "helloworld" config.xml file

I am having trouble following this tutorial. Below is my configuration file. Do I have the frontend section in the correct place? I can't seem to get this to work. I got to my site /helloworld/index/index, and nothing happens. What is supposed to happen?

app/code/local/Alanstormdotcom/Hellowowrld/etc/config.xml:

<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>

</config>   

app/code/local/Alanstormdotcom/Helloworld/controllers/IndexController.php:

class Alanstormdotcom_Helloworld_IndexController extends Mage_Core_Controller_Front_Action {        
    public function indexAction() {
        echo 'Hello Index!';
    }
}

app/etc/modules/Alanstormdotcom_Helloworld.xml

<config>
    <modules>
        <Alanstormdotcom_Helloworld>
            <active>true</active>
            <codePool>local</codePool>
        </Alanstormdotcom_Helloworld>
    </modules>
</config>       


What version of Magento are you running? I'm not sure whats wrong other then a cache issue. I have taken your files and they work great on 1.4.0.1 (other then the typo in the path to your config.xml unless thats not a typo)

Here is what I have that worked:

app/code/local/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>
</config>

app/code/local/Alanstormdotcom/Helloworld/controllers/IndexController.php

<?php

class Alanstormdotcom_Helloworld_IndexController extends Mage_Core_Controller_Front_Action {
    public function indexAction() {
        echo 'Hello Index!';
    }
}

app/etc/modules/Alanstormdotcom_Helloworld.xml

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

Soo yeah basically the same thing ... have you tried turning cache completely off?


You could try two solutions:

1) refresh the cache of Magento and try to reload the page

2) change the tag right below tag with (and refresh your cache)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜