【发布时间】:2015-07-23 15:20:33
【问题描述】:
我正在关注 answer 到 stackoverflow 问题 576908,但我似乎遇到了 404 错误。有谁知道我做错了什么。即初学者的错误?
索引控制器:
<?php
class MyCompanyName_HelloWorld_IndexController extends Mage_Core_Controller_Front_Action{
public function indexAction(){
echo "We're echoing just to show that this is what's called, normally you'd have some kind of redirect going on here";
}
}
Config.xml:
<?xml version="1.0"?>
<config>
<modules>
<mycompanyname_helloworld>
<version>
0.1.0
</version>
</mycompanyname_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>MyCompanyName_HelloWorld</module>
<frontName>helloworld</frontName>
</args>
</helloworld>
</routers>
</frontend>
</config>
在 app/etc/modules 中:
<?xml version="1.0"?>
<config>
<modules>
<MyCompanyName_Helloworld>
<active>true</active>
<codePool>community</codePool>
</MyCompanyName_Helloworld>
</modules>
</config>
我一直收到一个
404 错误
当我点击网址时
magento.dev/index.php/helloworld
//NB 这个url是我的开发机器上的一个虚拟主机。
我正在运行 magento 1.8
【问题讨论】: